@ndhoule/every

2.0.1 • Public • Published

every CI

Check if a predicate function returns true for all values in a collection.

Installation

$ component install ndhoule/every
$ npm install @ndhoule/every

API

every(predicate : Function, collection : Array|Object|String)

var isEven = function(num) { return num % 2 === 0; };

every(isEven, []); // => false
every(isEven, [1, 2]); // => false
every(isEven, [2, 4, 6]); // => true

License

Released under the MIT license.

Package Sidebar

Install

npm i @ndhoule/every

Weekly Downloads

21,568

Version

2.0.1

License

MIT

Last publish

Collaborators

  • ndhoule