Prepends a single item ahead of all elements produced by the source iterable.
Element type produced by the source iterable.
Source iterable that will be prefixed with item when enumerated.
item
Element yielded before any value from the source iterable.
A deferred iterable that first yields item and then every element from src.
src
const values = [..._prepend([2, 3], 1)];console.log(values); // [1, 2, 3] Copy
const values = [..._prepend([2, 3], 1)];console.log(values); // [1, 2, 3]
or using the curried version:
const values = [ ...pipeInto( [2, 3], prepend(1) ),];console.log(values); // [1, 2, 3] Copy
const values = [ ...pipeInto( [2, 3], prepend(1) ),];console.log(values); // [1, 2, 3]
Prepends a single item ahead of all elements produced by the source iterable.