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
  • 204,715
  • 48
  • 286
  • 369
CatGirl19
  • 199
  • 4
  • 16

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.

trognanders
  • 2,251
  • 22
  • 32