Iterator yielding return values of given no-arg function fn. If n is given, only that many values will be produced, else the iterator is infinite.
fn
n
[...repeatedly(() => Math.floor(Math.random() * 10), 5)] // [7, 0, 9, 3, 1]
value producer
num values (default: ∞)
Generated using TypeDoc
Iterator yielding return values of given no-arg function
fn
. Ifn
is given, only that many values will be produced, else the iterator is infinite.[...repeatedly(() => Math.floor(Math.random() * 10), 5)] // [7, 0, 9, 3, 1]