Skip to content
Subhajit Sahu edited this page Mar 15, 2020 · 25 revisions

Repeats an array gives times.

array.repeat(x, n)
// x: an array
// n: times
const array = require('extra-array');

var a = [1, 2];
array.repeat(a, 2);
// [1, 2, 1, 2]

array.repeat(a, 3);
// [1, 2, 1, 2, 1, 2]

references

Clone this wiki locally