-
Notifications
You must be signed in to change notification settings - Fork 5
repeat
Subhajit Sahu edited this page Nov 20, 2022
·
25 revisions
Repeat an array given times.
function repeat(x, n)
// x: an array
// n: times [1]
const array = require('extra-array');
var x = [1, 2];
array.repeat(x, 2);
// → [ 1, 2, 1, 2 ]
array.repeat(x, 3);
// → [ 1, 2, 1, 2, 1, 2 ]