effect-io-ai

Package: effect
Module: Array

Array.initNonEmpty

Get all but the last element of a non empty array, creating a new array.

Example

import { Array } from "effect"

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

Signature

declare const initNonEmpty: <A>(self: NonEmptyReadonlyArray<A>) => Array<A>

Source

Since v2.0.0