Standard built-ins

Iterator.prototype.every()

Try the free JavaScript compiler

Consumes until a predicate is falsy, closing on early failure; true for an empty sequence.

Formal Syntax & Structure

javascript syntaxjavascript
iterator.every(predicate)

Parameters & Attributes

NameTypeDescription
predicatefunctionTest callback.

Return Value

boolean

Result of the operation.

Working Example

Example Snippetjavascript
console.log(JSON.stringify(Iterator.from([1,2,3]).every(x=>x>0)));
JavaScript Reference