Skip to main content

CommonRandomItemFromList

Callable

  • CommonRandomItemFromList<T>(ItemPrevious, ItemList): T

  • Get a random item from a list while making sure not to pick the previous one. Function expects unique values in the list. If there are multiple instances of ItemPrevious, it may still return it.


    Parameters

    • ItemPrevious: T

      Previously selected item from the given list

    • ItemList: readonly T[]

      List for which to pick a random item from

    Returns T

    • The randomly selected item from the list