|
|
|
|
|
by masklinn
2512 days ago
|
|
Seems like a needlessly unreadable alternative to Array.from unless you're combining multiple iterables or values an iterables e.g. const unique = [...a, ...b];
You might expect that concat would work, but it doesn't handle arbitrary iterables: > [].concat([1][Symbol.iterator](), [2][Symbol.iterator]())
[Array Iterator, Array Iterator]
> [...[1][Symbol.iterator](), ...[2][Symbol.iterator]()]
[1, 2]
|
|