• Copies all elements of an Array into a new Array

    Example

    Copy an Array

    const array = [1, 2, 3];
    const copiedArray = copy(array);
    console.log(copiedArray); // [1, 2, 3]
    console.log(array === copiedArray); // false

    Returns

    a new Array containing all elements of the source Array

    Type Parameters

    • T

      the Array element type

    Parameters

    Returns T[]

Generated using TypeDoc