Skip to content

every()

(Covered in the some & every section — see above)

[1, 2, 3].every(x => x > 0); // true
[1, 2, 3].every(x => x > 1); // false

every() returns true only if the callback returns truthy for every element. It stops (short-circuits) as soon as it finds a falsy result.