Edit This Page

every(callback)

Tests whether all elements of the Enumerable pass the test implemented by the provided function. This is the equivalent of Array.prototype.every

Arguments

  • callback (function): function to execute for each element, taking (element, index, Enumerable.toArray)

Returns

(boolean): Indicate if all elements pass the given test.

Example

Enumerable
        .from([2, 1, 3])
        .every(x => x < 2);
// false

Aliases