DEV Community


Discussion on: Sorting Arrays of Strings in JavaScript

charlesmwray profile image
Charles Wray

Love this reply. It's exactly what I was looking for. I do want to comment that there is a typo in case someone else tries to use this like I did and it didnt work. In the localeSort variable assignment it should be

return a.localeCompare(b, 'en', { sensitivity: 'base' });

ricardorien profile image
Ricardo Aguilar

Thanks! both anwser are awesome!

Forem Open with the Forem app