melonjs
    Preparing search index...

    Function random

    • return a random array element

      Type Parameters

      • T

      Parameters

      • arr: T[]

        array to pick a element

      Returns T

      random member of array

      // Select a random array element
      let arr = [ "foo", "bar", "baz" ];
      console.log(me.utils.array.random(arr));