@mirei/ts-collections
    Preparing search index...

    Function append

    • Creates a sequence that yields the current elements followed by the supplied element.

      Type Parameters

      • TElement

        Type of elements within the source iterable.

      Parameters

      • source: Iterable<TElement>

        The source iterable.

      • element: TElement

        Element appended to the end of the sequence.

      Returns IEnumerable<TElement>

      A new enumerable whose final item is the provided element.

      The source sequence is not modified; enumeration is deferred until the returned sequence is iterated.

      const numbers = [1, 2, 3];
      const appended = append(numbers, 4).toArray();
      console.log(appended); // [1, 2, 3, 4]