Materialises source into an array.
Type of elements within source.
The source iterable.
An array containing all elements from source in iteration order.
The entire sequence is enumerated immediately. Subsequent changes to source are not reflected in the returned array.
const numbers = [1, 2, 3];const array = toArray(numbers);console.log(array); // [1, 2, 3] Copy
const numbers = [1, 2, 3];const array = toArray(numbers);console.log(array); // [1, 2, 3]
Materialises source into an array.