Skip to content

prepend

Array.prepend(array, value)

Adds value to the beginning of array.

Example

ts
import { Array } from "@monstermann/array";

Array.prepend([2, 3, 4], 1); // [1, 2, 3, 4]
ts
import { Array } from "@monstermann/array";

pipe([2, 3, 4], Array.prepend(1)); // [1, 2, 3, 4]