Skip to content

every() function

Returns true if all of the values in Iterable/AsyncIterable pass the f truth test.

Signature:

typescript
declare function every<A extends readonly []>(f: Arrow, iterable: A): true;

Example

ts
every((a) => a % 2 === 0, [2, 4, 6, 8, 10]);
// true

every((a) => a % 2 === 0, [2, 4, 6, 7, 10]);
// false

Try It

Open Source Code

Released under the Apache-2.0 License.