3 ms·
So how should [1, "a", 2, 3] be sorted by default?
by Yaggo 13y ago
So how should [1, "a", 2, 3] be sorted by default?
- integraton 13y agoBoth Python and Erlang would return [1,2,3,"a"], Ruby and Clojure won't allow the comparison. Either of these approaches makes more sense than JavaScript's.
- bpicolo 13y agoJavascript returns [1,2,3,a]. What's the problem.
- integraton 13y ago> [1,2,"10",3].sort() [ 1, '10', 2, 3 ] That's the problem.