Utilities to deal with arrays
npm i @hazae41/arrays
- 100% TypeScript and ESM
- No external dependency
- Unit-tested and benchmarked
- Get the last value
- Get a random value using Math's PRNG
- Get a random value using WebCrypto's CSPRNG
Get the last value
import { Arrays } from "@hazae41/arrays"
const value = Arrays.last([1, 2, 3, 4, 5])
Get a random value using Math's PRNG
import { Arrays } from "@hazae41/arrays"
const value = Arrays.random([1, 2, 3, 4, 5])
Get a random value using WebCrypto's CSPRNG
import { Arrays } from "@hazae41/arrays"
const value = Arrays.cryptoRandom([1, 2, 3, 4, 5])