MCQs > IT & Programming > JavaScript > What is the value of 'n1' and 'n2' after executing the following code? var str = 'Finding foo in Foo and Bar'; var nl = str.search('Foo'); var n2 = str.search(/Foo/i);

JavaScript MCQs

What is the value of "n1" and "n2" after executing the following code?


var str = "Finding foo in Foo and Bar";

var nl = str.search("Foo");

var n2 = str.search(/Foo/i);


Answer

Correct Answer:

nl = 15, n2 = 8

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it