3 ms·
that looks pretty horrible if you ask me
by Morgawr 13y ago
that looks pretty horrible if you ask me
- twerquie 13y agoIt can (and should!) be written more elegantly [5, 10, 1].sort(function(a, b) { return a - b }) Or, in ES6: [5, 10, 1].sort((a, b) => { a - b }) That's starting to look pretty nice if you ask me.