[Solved] Need an If Statement syntax explanation [closed]

[ad_1]

The indexOf method returns the index of the searched string. If the string is not found, it returns -1. That’s why you have that comparison, it’s to make sure that the searched string is found.

1

[ad_2]

solved Need an If Statement syntax explanation [closed]