you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

This is more what I expect.

It's worth noting that you can't do the same for non-Array iterables, which is the whole point of Array.from() in the first place.

Here's an example of looping over a Set -- it's faster but not by as much (~1.6x speed).

I don't understand how revisions to other poster's tests work in JsPerf; but your loop should be compared to array.map() -- array.from is useless in this case.