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