Ask Question
13 August, 15:07

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.

+3
Answers (1)
  1. 13 August, 15:43
    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?
Find an answer to your question ✅ “Assume courseTitle = "Principles in Information Technology and Computation"; What does the following jа vascript statement do? var ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers