Object.every

Object.every

Object.every

Function

Determine whether all key-value pairs in the object make the callback result true.

Syntax

Parameters

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

Return value

TypeDescription
BoolReturns true if all are true, false otherwise.

Example

Notes

  • every does not modify the original object.
  • The traversal will stop immediately upon encountering the first false value result.