9 lines
170 B
JavaScript
9 lines
170 B
JavaScript
|
'use strict';
|
||
|
|
||
|
module.exports = function times(n, fn) {
|
||
|
for (var iterator = 1; iterator <= n; iterator += 1) {
|
||
|
this.items.push(fn(iterator));
|
||
|
}
|
||
|
|
||
|
return this;
|
||
|
};
|