O'Reilly logo
  • Ahmed Elgendy thinks this is interesting:

So, using indexOf, we can write the code to find a hit like this:

image with no caption

U

From

Cover of Head First JavaScript Programming

Note

How to find whether something exists in a loop (at a specific index) using index of?