Ask Question
15 June, 14:12

Assume courseTitle = "Principles in Information Technology and Computation";

What does the following jа vascript statement do?

var something = courseTitle. search ('o');

It finds all o's and save them to variable something.

It saves the position of the first occurrence of "o" to variable something.

It saves the position of the last occurrence of "o" to variable something.

It will save a true or false to something depends on whether there is an 'o' in courseTitle.

+2
Answers (1)
  1. 15 June, 14:48
    0
    It saves the position of the first occurrence of "o" to variable something.

    Explanation:

    The search () method in jа vascript searches the expression or the string and returns the position of it's first occurrence and if not found it returns - 1.

    So in the code given above it will search for character o and returns the position of it's first occurrence that is 16 and if there were no o in the string then it would have returned - 1.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Assume courseTitle = "Principles in Information Technology and Computation"; What does the following jа vascript statement do? var ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers