JavaScript Associate — Easy
Key points
- indexOf() returns the index of the first occurrence of a substring.
- If the substring is not found, indexOf() returns -1.
- search() and find() are similar but do not return the index.
- includes() checks if a substring is present, but does not return the index.
Ready to go further?
Related questions
