-
Notifications
You must be signed in to change notification settings - Fork 1
repeat
wolfram77 edited this page Mar 27, 2020
·
27 revisions
Repeats an iterable given times.
iterable.repeat(x, n)
// x: an iterable
// n: times
const iterable = require('extra-iterable');
var x = [1, 2];
[...iterable.repeat(x, 2)];
// [1, 2, 1, 2]
[...iterable.repeat(x, 3)];
// [1, 2, 1, 2, 1, 2]