effect-io-ai

Package: effect
Module: Array

Array.prepend

Prepend an element to the front of an Iterable, creating a new NonEmptyArray.

Example

import { Array } from "effect"

const result = Array.prepend([2, 3, 4], 1)
console.log(result) // [1, 2, 3, 4]

Signature

declare const prepend: { <B>(head: B): <A>(self: Iterable<A>) => NonEmptyArray<A | B>; <A, B>(self: Iterable<A>, head: B): NonEmptyArray<A | B>; }

Source

Since v2.0.0