@kuneho@lemmy.world to Programmer Humor@programming.dev • edit-21 year agoJavaScript always know my truest of desireslemmy.worldimagemessage-square37fedilinkarrow-up1436file-text
arrow-up1436imageJavaScript always know my truest of desireslemmy.world@kuneho@lemmy.world to Programmer Humor@programming.dev • edit-21 year agomessage-square37fedilinkfile-text
minus-square@Quasari@programming.devlinkfedilink21•edit-21 year 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-square@stratoscaster@lemmy.ziplinkfedilink17•1 year agoFuck JS is stupid. Source: use JS regularly
deleted by creator
It does.
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