Object.some

Object.some

Object.some

Function

Determine whether there is a key-value pair in the object so that the callback result is true.

Syntax

Parameters

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

Return value

TypeDescription
BoolReturns true if a match exists, false otherwise.

Example

Notes

  • some does not modify the original object.
  • The traversal will stop immediately when the first true result is encountered.