UNPKG

lazzy.ts

Version:

Fast and lightweight library for lazy operations with iterable objects.

10 lines 297 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.randomFrom = void 0; function* randomFrom(array) { while (true) { yield array[Math.trunc(Math.random() * array.length)]; } } exports.randomFrom = randomFrom; //# sourceMappingURL=randomFrom.js.map