-
Notifications
You must be signed in to change notification settings - Fork 1
fromApplication
Subhajit Sahu edited this page Feb 3, 2021
·
1 revision
Generate iterable from repeated function application.
Alternatives: from, fromIterator, fromRange, fromInvocation, fromApplication.
function fromApplication(fm, v)
// fm: map function (v, i)
// v: start value
const xiterable = require('extra-iterable');
[...xiterable.fromApplication(v => v+2, 2, 4)];
// → [2, 4, 6, 8]
[...xiterable.fromApplication(v => v*2, 2, 4)];
// → [2, 4, 8, 16]