Options
All
  • Public
  • Public/Protected
  • All
Menu

Module array/append

Index

References

Functions

References

Renames and re-exports append

Functions

  • append<U, V>(el: U, list: ArrayLike<V>): (U | V)[]
  • append<U>(el: U): <V>(list: ArrayLike<V>) => (U | V)[]
  • Returns a new list containing the contents of the given list, followed by the given element.

    example
     append('tests', ['write', 'more']); //=> ['write', 'more', 'tests']
    append('tests', []); //=> ['tests']
    append(['tests'], ['write', 'more']); //=> ['write', 'more', ['tests']]

    Type parameters

    • U

    • V

    Parameters

    • el: U

      The element to add to the end of the new list.

    • list: ArrayLike<V>

      The list of elements to add a new item to. list.

    Returns (U | V)[]

    A new list containing the elements of the old list followed by el.

  • Returns a new list containing the contents of the given list, followed by the given element.

    example
     append('tests', ['write', 'more']); //=> ['write', 'more', 'tests']
    append('tests', []); //=> ['tests']
    append(['tests'], ['write', 'more']); //=> ['write', 'more', ['tests']]

    Type parameters

    • U

    Parameters

    • el: U

      The element to add to the end of the new list.

    Returns <V>(list: ArrayLike<V>) => (U | V)[]

    A new list containing the elements of the old list followed by el.

      • <V>(list: ArrayLike<V>): (U | V)[]
      • Type parameters

        • V

        Parameters

        • list: ArrayLike<V>

        Returns (U | V)[]

Generated using TypeDoc