-
Notifications
You must be signed in to change notification settings - Fork 5
fromInvocation
Subhajit Sahu edited this page May 3, 2023
·
3 revisions
Generate array from repeated function invocation.
Alternatives: from, from$.
Similar: from, fromRange, fromInvocation, fromApplication.
function fromInvocation(fn, n)
// fn: function
// n: number of values
const xarray = require('extra-array');
var n = 0;
xarray.fromInvocation(() => ++n, 4);
// → [ 1, 2, 3, 4 ]