Exercise:

Display the position of the first occurrence of "World" in the variable txt.

Hint: Use the indexOf() method.

Edit This Code:
Result:
Correct Code:
Correct Result:
Exercise - © w3schools.com