1

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() be a better alternative?

georg
  • 211,518
  • 52
  • 313
  • 390
CatGirl19
  • 209
  • 6
  • 18

1 Answers1

2

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.

le3th4x0rbot
  • 2,493
  • 23
  • 32