My Report

JavaScript Practice Test 2


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. The behaviour of the instances present of a class inside a method is defined by __________

2. Which is the subset that transforms web content into secure modules that can be safely hosted on a web page?

3. What will be the last statement return in the following JavaScript code?

function constfuncs() 
{
    var funcs = [];
    for(var i = 0; i < 10; i++)
        funcs[i] = function() { return i; };
    return funcs;
}
var funcs = constfuncs();
funcs[5]()

4. What is the opposite approach to the lexical scoping?

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

var add=new Function("num1","num2","return num1+num2");  
document.writeln(add(2,5));  

6. What is being imposed on each subset to ensure that it conforms to the subset?

7. What will be the result when non greedy repetition is used on the pattern /a+?b/?

8. The regular expression to match any one character not between the brackets is __________

9. What kind of scoping does JavaScript use?

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

var scope = "global scope";
function checkscope() 
{
    var scope = "local scope"; 
    function f() 
    { 
         return scope; 
    }
    return f;
}

 

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.