BACK
Referenceevery
Reference · 61

every

Checks that all values satisfy the predicate.

Signature

every(predicate: (value: T, index: number) => boolean): OperatorFunction

What it does

Emits false immediately on the first value that fails the check. If the stream completes and every value passed, it emits true.

When to use

Validating a finite list of events, checking permissions/flags, a guard before the next phase.

See also

filter, find, count

script.ts // TypeScript
CONSOLE · Console output
Hit Run to see the result...