Function arrRemoveDuplicates

  • Remove duplicates from an array

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array from which to remove duplicates.

    Returns T[]

    The new array with duplicates removed.

    Remarks

    This function uses the JavaScript Set object to remove duplicate values from an array.

    Typeparam

    T - The type of elements in the array.

    Example

    const array = [1, 2, 2, 3, 4, 4, 5];
    arrRemoveDuplicates(array);
    //=> [1, 2, 3, 4, 5]

Generated using TypeDoc