math docs
    Preparing search index...

    Function choice

    • Returns a random item from an array.

      Type Parameters

      • T

      Parameters

      • random: RandomGenerator

        the random generator to use

      • items: T[]

        the array to choose from

      Returns T

      if the array is empty