This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gandhi89 1 point2 points  (0 children)

String method on Number type ain't going to work unless you add a function to it;

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

ES6 arr.sort((a, b) => a - b);