Why doesn't Array.from() pass the array to the mapFn?
Jordan Harband
ljharb at gmail.com
Wed May 3 21:36:42 UTC 2017
Good point :-) i guess as the destination index it makes sense, altho i've
always thought of it as the source index.
On Wed, May 3, 2017 at 12:58 PM, T.J. Crowder <
tj.crowder at farsightsoftware.com> wrote:
> On Wed, May 3, 2017 at 7:35 PM, Jordan Harband <ljharb at gmail.com> wrote:
>
>> (an index in Array.from wouldn't make sense, because Array.from takes an
>> iterable *or* an arraylike - and only an arraylike would be guaranteed to
>> have an index, or even a "list" at all)
>>
>
> And yet, [it provides one](https://tc39.github.io/ecma262/#sec-array.from).
> It's the index that will be used to set the array entry from the result.
> It's only the third argument (the source object) that `Array.from` doesn't
> include.
>
> -- T.J. Crowder
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170503/73566af2/attachment.html>
More information about the es-discuss
mailing list