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