@extra-array/from-apply
v2.10.19
Published
Generates array from function application.
Downloads
29
Maintainers
Readme
Generates array from function application. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:
This is part of package extra-array.
array.fromApply(fn, v, [n]);
// fn: map function (v, i, x)
// v: start value
// n: number of values (0)
const array = require("extra-array");
array.fromApply(v => v+2, 2, 4);
// [ 2, 4, 6, 8 ]
array.fromApply(v => v*2, 2, 4);
// [ 2, 4, 8, 16 ]