Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Array

Extensions to the Array class.

Hierarchy

  • Array

Index

Methods

pick

  • pick(): any
  • Returns one element from the array, selected at random.

    throws

    if no choice is possible (because the array is empty)

    Returns any

    a randomly selected array element

pickOtherThan

  • pickOtherThan(excluded: any): any
  • Returns one element from the array, selected at random, except for the excluded value.

    throws

    if no choice is possible (because the array is empty or has no element not excluded)

    Parameters

    • excluded: any

      the element to be excluded from selection

    Returns any

    a randomly selected array element other than excluded

shuffle

  • shuffle(): void
  • Shuffles the array elements into random order.

    Returns void