Package: effect
Module: Array
Adds a single element to the end of an iterable, returning a NonEmptyArray.
When to use
Use when you need to guarantee a non-empty result after adding a required trailing value.
Example (Appending an element)
import { Array } from "effect"
const result = Array.append([1, 2, 3], 4)
console.log(result) // [1, 2, 3, 4]
See
prepend — add to the frontappendAll — append multiple elementsSignature
declare const append: { <B>(last: B): <A>(self: Iterable<A>) => NonEmptyArray<A | B>; <A, B>(self: Iterable<A>, last: B): NonEmptyArray<A | B>; }
Since v2.0.0