Skip to content Skip to sidebar Skip to footer

LocaleCompare() Vs .Sort For Alphabetically Sorting

Im sorting an array of objects alphabetically but not sure which way is more efficient. Im currently using the .sort() method and its working fine but would using the localeCompare

Solution 1:

The localeCompare function is absurdly slow on many browser. Avoid it if possible. The other locale functions are really bad too, particularly the number to string ones.


Post a Comment for "LocaleCompare() Vs .Sort For Alphabetically Sorting"