Add arrays.js
This commit is contained in:
parent
c27b0cfc64
commit
b25df1051a
1 changed files with 12 additions and 0 deletions
12
make/arrays.js
Normal file
12
make/arrays.js
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
make.arrays = {
|
||||||
|
filledArray: function (fn, limit) {
|
||||||
|
let array = [];
|
||||||
|
let size = limit || random.number(make.tinyNumber);
|
||||||
|
|
||||||
|
for (let i = 0; i < size; i++) {
|
||||||
|
array.push(fn());
|
||||||
|
}
|
||||||
|
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue