You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param partsAmt Into how many parts the array should be split
154
154
* @param balanced Default (false): returned parts all have the same length except the last one. (true): returned parts are equally balanced and have similar lengths.
* @returns Returns a random item of the provided array. Returns undefined if the array is empty.
306
308
* @since 1.9.4
307
309
*/
308
-
functionrandomItem<T>(array: T[]): T|undefined;
310
+
functionrandomItem<T>(array: T[]): T;
309
311
310
312
/**
311
313
* 🔹 Chooses a random item in an array and returns it, along with its index in the array. 🔹
312
314
* @param array An array of any size, with any values contained inside
313
315
* @returns Returns a tuple array with two entries. First entry is the randomly chosen item, second entry is the index of the random item. Returns undefined if the array is empty.
0 commit comments