Returns a random array index.
import { Arrays } from 'https://unpkg.com/ixfx/dist/data.js';const v = [`blue`, `red`, `orange`];Arrays.randomIndex(v); // Yields 0, 1 or 2 Copy
import { Arrays } from 'https://unpkg.com/ixfx/dist/data.js';const v = [`blue`, `red`, `orange`];Arrays.randomIndex(v); // Yields 0, 1 or 2
Use randomElement if you want a value from array, not index.
array
Array
Random generator. Math.random by default.
Math.random
Returns a random array index.
Use randomElement if you want a value from
array
, not index.