Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

iterate-until

0.0.1 • Public • Published

iterate-until

Iteratively invokes a function until condition is met.

Install

npm install iterate-until
bower install iterate-until

Usage

var iterateUntil = require('iterate-until');
 
function addTwo(i) {
  return i + 2;
}
 
function isLessThanEight(n) {
  return n < 8;
}
 
var initial = 0;
 
var result = iterateUntil(isLessThanEight, addTwo, initial);
 
console.log(result); // [2,4,6]

License

MIT

Keywords

install

npm i iterate-until

Downloadsweekly downloads

1

version

0.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability