News for hackers. Stuff that matters.
Re:“It is never a compiler error” by bzbarsky on Tuesday November 14, 2017 @11:59PM (#15701569)
While true, the use of sort() to sort an array of numbers in JS is ... complicated. It works for the single-digit-number case, but if you can have multi-digit numbers you better remember to pass a comparator function to get numeric sorting, because JS sort() defaults to lexicographic sort. So it will sort 10 before 2 by default.

There are no comments on this comment yet.