5 ms·
[1,10,5,-15,-2,4].sort (a, b) -> a-b You're right; that was totally difficult.
by rmrfrmrf 13y ago
[1,10,5,-15,-2,4].sort (a, b) -> a-b
You're right; that was totally difficult.
- anon1385 13y agoSafari/Chrome: SyntaxError: Unexpected token '>' Firefox: SyntaxError: syntax error In a discussion about Javascript maybe it would be a good idea to give examples of Javascipt that actually run in a Javascript console?
- daleharvey 13y agoFirefox Nightly [1,10,5,-15,-2,4].sort ((a, b) => a-b).toString(); "-15,-2,1,4,5,10"
- camus2 13y agoPeople dont write JS just for Firefox Nightly.
- daleharvey 13y agoI didnt say they should (some people do), it is code which works with a JavaScript console though
- anon1385 13y agoYou have responded to my pointing out that '->' syntax doesn't work in current browsers with an example of a different bit of syntax, '=>', that works in a single development browser. I don't follow your point.
- daleharvey 13y agoSorry you asked for an example which works in a Javascript console, I gave one, if you were trying to make a snarky reply about the state of es6 support in modern browsers then I misread it.
- anon1385 13y agoActually when I posted it I was honestly unaware if that was ES6 Javascript or just Coffescript or something. People seem to throw them all about interchangeably which is very confusing to people like me who don't follow Javascript development.