• JMap.Util.Array.remove

    Remove given element in given array.

    Type Parameters

    • T

    Parameters

    • array: T[]

      the array

    • element: T

      the element to remove

    Returns T[]

    the given array (and not a copy)

    Example

    const myNumbers = [3, 5, 6, 7]
    // remove element 6 in array
    JMap.Util.Array.remove(myNumbers, 6)
    console.log(`Now my numbers are [${myNumbers.join(", ")}]`)
    // display message "Now my numbers are [3, 5, 7]"