Object.find

Object.find

Object.find

Function

Returns the first value for which the callback result is true.

Syntax

Parameters

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

Return value

TypeDescription
Any/EmptyReturns the corresponding value when found, otherwise returns Empty.

Example

Notes

  • find traverses objects in order of insertion.
  • The traversal stops as soon as the first matching value is found.