js-helpers

Every

Every (Array array, [Function predicate=JsHelpers.isTruthy])

Checks if every item of *Array* array returns true from *Function* predicate.

Arguments

Array array

Collection of items to iterate over with *Function* predicate.

[Function predicate=JsHelpers.isTruthy]

Function to invoke per item of *Array* array.

Use

import { Every } from "@taystack/js-helpers";

const items = [5,6,7,8,9]
Every(items, x => (x > 4)); // true
Every(items, x => (x > 5)); // false

Source: @taystack/js-helpers hosted on GitHub Author: taystack