How to sort numbers correctly with Array.sort()? [duplicate]

a.sort(function(a,b){return a - b})

These can be confusing…. check this link out.

Leave a Comment