MCQs > IT & Programming > JavaScript > What's the output? var a = /xy/i, b = new RegExp(a, 'g'); console.log(a.test('xy')); console.log(b.test('xy')); console.log(a.test('XY')); console.log(b.test('XY'));

JavaScript MCQs

Determine the output of the given code snippet.
var a = /xy/i,
b = new RegExp(a, "g");
console.log(a.test("xy"));         
console.log(b.test("xy")); 
console.log(a.test("XY"));
console.log(b.test("XY")); 



Answer

Correct Answer: true<br>true<br>true<br>false

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