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