#js question:
How can I sort an array of arrays of numbers based on the first item of each subarray ?
[[1,2],[3,4]].sort((a,b)=>a[0]<b[0]) // [[1, 2], [3, 4]
[[1,2],[3,4]].sort((a,b)=>a[0]>b[0]) // [[1, 2], [3, 4]
// Whyyy?
-
-
Indeed ! I should output a signed number, not a boolean (I get trapped everytime)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.