@extra-array/unfoldr.min

2.2.1 • Public • Published

Builds array from a seed value (dual to foldr).

This is part of package extra-array.

This is browserified, minified version of @extra-array/unfoldr.
It is exported as global variable array_unfoldr.
CDN: unpkg, jsDelivr.

array.unfoldr(x, fn, v);
// fn: unreduce fn (v, i, x)
// v:  initial value of accumulator
// --> built array
const array = require('extra-array');

array.unfoldr(v => v===0? undefined : [v, v-1], 10);
// [ 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 ]

references

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @extra-array/unfoldr.min

      Weekly Downloads

      0

      Version

      2.2.1

      License

      MIT

      Unpacked Size

      2.97 kB

      Total Files

      3

      Last publish

      Collaborators

      • wolfram77