Add arrays.js

This commit is contained in:
Christoph Diehl 2017-04-12 23:16:44 +03:00
parent c27b0cfc64
commit b25df1051a

12
make/arrays.js Normal file
View 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;
}
}