Get a random value of an Array
import { array } from "@rjweb/utils"const arr = ['A', 'B', 'C', 'D', 'E']array.random(arr, 2) // 'C'array.random(arr, 4) // 'A' Copy
import { array } from "@rjweb/utils"const arr = ['A', 'B', 'C', 'D', 'E']array.random(arr, 2) // 'C'array.random(arr, 4) // 'A'
1.9.1
nodejs, browser
Get a random value of an Array