effect-io-ai

Package: effect
Module: Array

Array.unappend

Return a tuple containing a copy of the NonEmptyReadonlyArray without its last element, and that last element.

Example

import { Array } from "effect";

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

Signature

declare const unappend: <A>(self: NonEmptyReadonlyArray<A>) => [arrayWithoutLastElement: Array<A>, lastElement: A]

Source

Since v2.0.0