* Selects, uniformly at random, a single item from the array. * @param {string[]} arr Object to select from. * @return {?string} Single item from arr or null if arr was empty.
(arr)
| 276 | * @return {?string} Single item from arr or null if arr was empty. |
| 277 | */ |
| 278 | function selectRandomItem(arr) { |
| 279 | const rn = RANDOM_NUMBER_GENERATORS.accuratePrng(); |
| 280 | return arr[Math.floor(rn * arr.length)] || null; |
| 281 | } |
| 282 | |
| 283 | /** |
| 284 | * Selects which page-level experiment branches are enabled. If a given |
no outgoing calls
no test coverage detected