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
Linear scan from the fromIndex position (defaulting to 0), using strict equality (===) to compare each element with the search value. Handle negative fromIndex by adding it to the array length. Return true on the first match or false after exhausting the array.
Includes provides a boolean membership test that is more readable than indexOf !== -1. The fromIndex parameter enables searching from a specific position, useful for finding duplicates after a known index.
Updated Feb 2026