Options
All
  • Public
  • Public/Protected
  • All
Menu

Module shuffle

Index

References

Functions Array

References

Renames and re-exports shuffle

Array Functions

  • shuffle<T>(collection: Collection<T>): T[]
  • Creates an array of shuffled values, using a version of the Fisher-Yates shuffle.

    since

    5.11.0

    example
    shuffle([1, 2, 3, 4])
    // => [4, 1, 3, 2]

    Type Parameters

    • T

    Parameters

    • collection: Collection<T>

      The array to shuffle.

    Returns T[]

    Returns the new shuffled array.