Array.some

Array.some

Array.some

Function

Determine whether there is an element in the array and make the callback result true.

Syntax

Parameters

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

Return value

TypeDescription
BoolReturns true if the element exists, false otherwise.

Example

Notes

  • Returns false for an empty array.