Function arrShuffle

  • Shuffle items in an array in-place. Guarantees changes.

    Type Parameters

    • T

    Parameters

    • input: T[]

      The array to shuffle.

    Returns T[]

    The same array, but shuffled.

    Remarks

    This function does not guarantee that the order of the elements will be different after shuffling.

    Typeparam

    T - The type of the elements in the input array.

    Example

    const input = [1, 2, 3, 4, 5];
    arrShuffle(input);
    //=> [3, 1, 5, 2, 4]

Generated using TypeDoc