Adds a new item to the start of an array, or returns a new array if list is null or undefined.
list
Same as [x, ...list].
[x, ...list]
prepend(0)([3, 6, 9])// => [0, 3, 6, 9]prepend(0)(undefined)// => [0] Copy
prepend(0)([3, 6, 9])// => [0, 3, 6, 9]prepend(0)(undefined)// => [0]
Generated using TypeDoc
Adds a new item to the start of an array, or returns a new array if
list
is null or undefined.Same as
[x, ...list]
.