• Shuffle a Javascript array This function implements the so-called Fisher-Yates shuffle algorithm (Wikipedia) and is imperative.

    Parameters

    • anArray: any[]

      the array to shuffle

    Returns any[]

    an array with the same values, but shuffled