My Report

JavaScript Parsing Test – 1


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. What does it indicate when the radix value is 16?

2. What is the purpose of the method ActiveXObject()?

3. What will be the output of the following JavaScript code?

<p id="demo"></p>
<script>
var str = "HELLO, LOOK AT YOU!"; 
var patt1 = /\BLO/;
var result = str.search(patt1);
document.getElementById("demo").innerHTML = result;
</script>

4. What will be the radix value if the string begins with 0x?

5. What is the function of the XML parser?

6. To which of the following object does the print() method belong to?

7. What will happen if the radix parameter of the parseInt() function is omitted?

8. What is the purpose of the url json?

9. What will be the output of the following JavaScript code?

<p id="demo"></p>
<script>
function myFunction() 
{
   var str = "welcome to.\0JavaScript test."; 
   var patt1 = /\0/;
   var result = str.search(patt1);
   document.getElementById("demo").innerHTML = result;
}
</script>

10. What will be the output of the following JavaScript code?

<p id="demo"></p>
<script>
function myFunction() 
{
   var str = "hello \r world."; 
   var patt1 = /\r/;
   var result = str.search(patt1);
   document.getElementById("demo").innerHTML = result;
}
</script>

11. What is the parameter of the method Date.parse()?

12. What is the function of the parseInt() method?

13. What will be the output of the following JavaScript code?

<p id="demo"></p>
<script>
function myFunction() 
{
   var str = "hello to \r world."; 
   var patt1 = /\t/;
   var result = str.search(patt1);
   document.getElementById("demo").innerHTML = result;
}
</script>

14. Which is the function in JavaScript that will print the current page in JavaScript?

15. What will be the output of the following JavaScript code?

<p id="demo"></p>
<script>
function myFunction() 
{
   var str = "hello\f world."; 
   var patt1 = /\f/;
   var result = str.search(patt1);
   document.getElementById("demo").innerHTML = result;
}
</script>

 

Start practicing “1000 MCQs on JavaScript”, and once you are ready, you can take tests on all topics by attempting our “JavaScript Test Series”.

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.