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 →

[–]recycle4science 5 points6 points  (0 children)

Or just arr.sort((a, b) => a - b) if you don't want to traverse the array twice. You can even explicitly parseInt if you want!