Does anyone know how to properly sort an array in JavaScript? By default, the sort method doesn't work efficiently with numbers. For example:
a = [1, 23, 100, 3]
a.sort()
The sorted values of 'a' end up being:
[1, 100, 23, 3]
If you have any insights or suggestions, please let me know. Thank you!