8 lines
139 B
JavaScript
8 lines
139 B
JavaScript
|
module.exports = function loop (n, f) {
|
||
|
var result = Array(n)
|
||
|
for (var i = 0; i < n; ++i) {
|
||
|
result[i] = f(i)
|
||
|
}
|
||
|
return result
|
||
|
}
|