Function append

  • Append an element to the end of a Array, creating a new NonEmptyArray.

    Type Parameters

    • A

    Parameters

    • end: A

    Returns ((init) => NonEmptyArray<A>)

      • (init): NonEmptyArray<A>
      • Parameters

        • init: A[]

        Returns NonEmptyArray<A>

    Example

    import { append } from 'fp-ts/Array'
    import { pipe } from 'fp-ts/function'

    assert.deepStrictEqual(pipe([1, 2, 3], append(4)), [1, 2, 3, 4])

    Since

    2.10.0