3 ms·
There's a very big distinction. `...foo` requires `foo` to be an iterable (implements the iterator known symbol). `Array.From()` only requires it to be array-
by hajile 5y ago
There's a very big distinction.
`...foo` requires `foo` to be an iterable (implements the iterator known symbol).
`Array.From()` only requires it to be array-like and not necessarily iterable.
- dragonwriter 5y agoGood point. I don't think I've run into many non-iterable arraylikes, but I understand they used to be more common (e.g., a number of standard things that are now specced as iterable arraylikes used to be just the latter) and there’s probably a lot lurking in library/legacy code.