Vidyalelo
JavaScript · all questions

Classes And Modules
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

68

Questions

3/4

Page

Pick an option on a question to see the right answer and solution.

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

Select an option to see the answer and solution.

Why was “The Good Parts” designed as a language subset in JavaScript?

Select an option to see the answer and solution.

Which is the subset that is a secure container designed for the purpose of safely running untrusted JavaScript?

Select an option to see the answer and solution.

Why is the this keyword forbidden in JavaScript?

Select an option to see the answer and solution.

Which are the two functions that are not allowed in any secure subset?

Select an option to see the answer and solution.

Which is the object that defines methods that allow complete control over page content?

Select an option to see the answer and solution.

Which was one of the first security subsets proposed?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Consider the following code snippet
const pi=3.14;
var pi=4;
console.log(pi);
What will be the output for the above code snippet?

Select an option to see the answer and solution.

The let keyword can be used

Select an option to see the answer and solution.

The main difference between the variables declared with var and with let is

Select an option to see the answer and solution.

Consider the following code snippet
function oddsums(n) 
{
     let total = 0, result=[]; 
     for(let x = 1; x <= n; x++) 
     { 
        let odd = 2*x-1; 
        total += odd;
        result.push(total);
     }
     return result;
}

What would be the output if
oddsums(5);
is executed afted the above code snippet ?

Select an option to see the answer and solution.

Consider the following code snippet
console.log(p)
If p is not defined, what would be the result or type of error?

Select an option to see the answer and solution.

Consider the following code snippet
let x=x+1;
console.log(x);
What will be the result for the above code snippet?

Select an option to see the answer and solution.

Consider the following code snippet
[x,y]=[y,x];
What is the result of the above code snippet?

Select an option to see the answer and solution.

Which looping statement allows XML tags to appear in JavaScript programs and adds API for operating on XML data?

Select an option to see the answer and solution.

Which exception does the Iterators throw from their next() method when there are no more values to iterate, that work on finite collections ?

Select an option to see the answer and solution.

Which method of the iterable object returns an iterator object for the collection?

Select an option to see the answer and solution.

Consider the following code snippet
let succ = function(x) x+1, yes = function() true, no = function() false;
What convenience does the above code snippet provide?

Select an option to see the answer and solution.

Consider the following code snippet
data.sort(function(a,b),b-a);
What does the above code do?

Select an option to see the answer and solution.