kuneho to Programmer Humor@programming.dev · edit-22 years agoJavaScript always know my truest of desiresimagemessage-square38fedilinkarrow-up1395arrow-down16
arrow-up1389arrow-down1imageJavaScript always know my truest of desireskuneho to Programmer Humor@programming.dev · edit-22 years agomessage-square38fedilink
minus-squareQuasari@programming.devlinkfedilinkarrow-up18·edit-22 years agoArray.prototype.sort if no callback is passed to it will coerce non-undefined elements to strings when sorting. It does do that. To sort numbers passing a function like (a, b) => a - b is good enough.
minus-squarestratoscaster@lemmy.ziplinkfedilinkarrow-up13arrow-down1·2 years agoFuck JS is stupid. Source: use JS regularly
Array.prototype.sort
if no callback is passed to it will coerce non-undefined
elements to strings when sorting. It does do that.To sort numbers passing a function like
(a, b) => a - b
is good enough.Fuck JS is stupid.
Source: use JS regularly