ix
Version:
The Interactive Extensions for JavaScript
17 lines (15 loc) • 474 B
JavaScript
/**
* Converts an existing iterable to anarray of values.
*
* @template TSource The type of elements in the source sequence.
* @param {Iterable<TSource>} source The source sequence to convert to an array.
* @returns {TSource[]} All the items from the source sequence as an array.
*/
export function toArray(source) {
const results = [];
for (const item of source) {
results.push(item);
}
return results;
}
//# sourceMappingURL=toarray.mjs.map