T.J. Crowder (2017-05-03T11:46:20.000Z)
On Wed, May 3, 2017 at 12:39 PM, the kojoman <kojoman at gmail.com> wrote:

> Thanks for the clarification. I thought the mapping was applied
> afterwards.
>
> I would still argue that it would be better to skip it all together than
> having it and not working like the existing map function.
>
So Array.from(array-like).map(mapFn) is the way to go then?
>

Why make two passes over the contents rather than just one?

It is interesting that `Array.from` doesn't pass its first parameter
(`items`, the source object) as the third argument to the mapping function.
I suspect it's because the index doesn't necessarily work with the source
object, if an iterator is being used...

-- T.J. Crowder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170503/1565af38/attachment.html>
tj.crowder at farsightsoftware.com (2017-05-03T13:05:43.505Z)
On Wed, May 3, 2017 at 12:39 PM, the kojoman <kojoman at gmail.com> wrote:

> Thanks for the clarification. I thought the mapping was applied
> afterwards.
>
> I would still argue that it would be better to skip it all together than
> having it and not working like the existing map function.
>
> So Array.from(array-like).map(mapFn) is the way to go then?

Why make two passes over the contents rather than just one?

It is interesting that `Array.from` doesn't pass its first parameter
(`items`, the source object) as the third argument to the mapping function.
I suspect it's because the index doesn't necessarily work with the source
object, if an iterator is being used...

-- T.J. Crowder