Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
Iterate through the array and test each element with the callback predicate. Return the first element for which the callback returns truthy, short-circuiting the loop. If no element matches, return undefined.
Find uses early return to stop iteration as soon as a match is found, making it more efficient than filter when only the first match is needed. Returning undefined for no match distinguishes it from returning a falsy found value.
Updated Feb 2026