• Adds one or more elements to the beginning of the array.

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array to add the elements to

    • Rest ...elementN: T[]

      The element(s) to add to the beginning of the array

    Returns T[]

    The new array with the elements added to the beginning of it.

    Example

    <pre> 
    const original = ["a", "b"];
    const result = ["c", "d", "a", "b"];
    expect(pull(original, "c", "d")).to.eql(result);
    </pre>

Generated using TypeDoc