Cyril Auburtin (2018-06-24T15:34:14.000Z)
cyril.auburtin at gmail.com (2018-06-24T16:14:30.274Z)
What I'd really like is something to avoid `Array.from({length: n}, (_, i) => ..)` It's very common to use it nowadays on the + side, it's a wider feature than range, the callback is more powerful to build any kind of ranges but it feels quite hacky and verbose. you can make a typo on 'length', and have to use the second callback argument. I'd like a lot a `Array.whateverNameAsShortAsPossible(4, i => 2*i+1)`(gives [1, 3, 5, 7]) I think [`Array.build`](http://array.build) was proposed a long time ago
cyril.auburtin at gmail.com (2018-06-24T15:37:44.093Z)
What I'd really like is something to avoid `Array.from({length: n}, (_, i) => ..)` It's very common to use it nowadays on the + side, it's a wider feature than range, the callback is more powerful to build any kind of ranges but it feels quite hacky and verbose. you can make a typo on 'length', and have to use the second callback argument. I'd like a lot a `Array.whateverNameAsShortAsPossible(4, i => 2*i+1)`(gives [1, 3, 5, 7]) I think [`Array.build`](http://array.build) was proposed a long time ago Le mer. 14 déc. 2016 à 21:28, Alexander Jones <alex at weej.com> a écrit :
cyril.auburtin at gmail.com (2018-06-24T15:37:12.562Z)
What I'd really like is something to avoid `Array.from({length: n}, (_, i) => ..)` It's very common to use it nowadays on the + side, it's a wider feature than range, the callback is more powerful to build any kind of ranges but it feels quite hacky and verbose. you can make a typo on 'length', and have to use the second callback argument. I'd like a lot a `Array.whateverNameAsShortAsPossible(4, i => 2*i+1)`(gives [1, 3, 5, 7]) I think `Array.build` was proposed a long time ago (array.build) Le mer. 14 déc. 2016 à 21:28, Alexander Jones <alex at weej.com> a écrit :