@extra-array/repeat
v2.10.19
Published
Repeats an array given times.
Downloads
1,605
Readme
Repeats an array given times. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:
This is part of package extra-array.
array.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 ]