6 ms·
No list comprehension? No, Thanks.
by wensheng 14y ago
No list comprehension? No, Thanks.
- wingspan 14y agoWould be a good thing to suggest to the team, it is the first release of the language, after all. In the interim, a simple library like underscore is quite succinct: _.map([1,2,3], n => n * n) With more library support you could even do infinite lists with something like this: _.generate(index => 1.0 / index);