String.prototype.normalize()
to convert the string to a normalized Unicode format.String.prototype.replace()
to replace diacritical marks in the given Unicode range by empty strings.const removeAccents = str => str.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
removeAccents('Antoine de Saint-Exupéry'); // 'Antoine de Saint-Exupery'
Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️