(Solved):In Javascript, write a script that inputs several lines of text and a search character and uses…

 

Question

In Javascript, write a script that inputs several lines of text and a search character and uses String method indexOf to determine the number of occurrences of the character in the text.

 

EXPERT ANSWER

The following Javascript script accepts input from an end-user for several lines of text and a search character.

The script uses the String method indexOf to determine the number of occurrences of the character in the text.

Scroll to top