4 ms·
Wow, this looks awesome. > [x+1 for (x of @[1,2,3])] I wasn't aware Objective-C++ or JavaScript supported list comprehensions like that.
by spicyj 13y ago
Wow, this looks awesome.
> [x+1 for (x of @[1,2,3])]
I wasn't aware Objective-C++ or JavaScript supported list comprehensions like that.
- saurik 13y agoThis is a feature from "JavaScript 1.7" (the versions after 1.5 are Firefox-only). There is a similar feature in ECMAScript 6, but the syntax is slightly different. I support both the Firefox-specific syntax and the current ECMAScript draft. (But yeah, if you try that expression without the Objective-C @ symbol in Firefox, it will actually work.) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Predefined_Core_Objects#Array_comprehensions https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guid...