unshift()
unshift<
T
>(arr
): (x
) =>T
[]
Returns a new array with the given value added to the start.
Type Parameters
• T
The type of array elements.
Parameters
arr
T
[]
The array to add an item to.
Returns
Function
Parameters
x
T
Returns
T
[]
Remarks
pure function
Example
import { unshift } from '@accelint/core';
push([1, 2, 3, 4])(0);
// [0, 1, 2, 3, 4]