Array.every

Array.every

Array.every

Function

Determine whether all elements in the array have a callback result of true.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
callbackFnNoEmptyThe callback signature is fn(value, index, current).

Return value

TypeDescription
BoolReturns true if all are true, false otherwise.

Example

Notes

  • Returns true for an empty array.