At least Array.build isn't "taken" by MooTools.

For the particular example, I prefer something like [...take(4, oddNumbers())], 
but in some cases Array.build would provide better clarity.

    On Sunday, June 24, 2018, 10:34:58 AM CDT, Cyril Auburtin 
<cyril.aubur...@gmail.com> wrote:  
 
 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) // [1, 3, 
5, 7]` I think `Array.build` was proposed a long time ago (array.build)

  
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to