phaser/v3/typings/utils/array/GetRandomElement.d.ts
2017-01-16 22:43:07 +01:00

13 lines
612 B
TypeScript

/**
* Fetch a random entry from the given array.
*
* Will return null if there are no array items that fall within the specified range
* or if there is no item for the randomly chosen index.
*
* @method
* @param {any[]} objects - An array of objects.
* @param {integer} startIndex - Optional offset off the front of the array. Default value is 0, or the beginning of the array.
* @param {integer} length - Optional restriction on the number of values you want to randomly select from.
* @return {object} The random object that was selected.
*/
export default function (array: any, start: any, length: any): any;