JavaScript Questions & Answers – JavaScript Subsets | JavaScript MCQs
Questions
1
The Crockford’s subset does not include which function in JavaScript?
Answer: eval()
2
What does javascript use instead of == and !=?
Answer: It uses === and !== instead
⭐ Make GKSeries Your Preferred Source on Google
Add GKSeries as Preferred Source
3
What is being imposed on each subset to ensure that it conforms to the subset?
Answer: A static verifier that parses code
4
Why was “The Good Parts” designed as a language subset in JavaScript?
Answer: To improve programmer productivity
5
Which is the subset that is a secure container designed for the purpose of safely running untrusted JavaScript?
Answer: Sandbox
6
Why is this keyword not preferred in JavaScript?
Answer: Functions should not access the global objects
7
Which are the two functions that are not allowed in any secure subset?
Answer: debugger() and test()
8
Which is the object that defines methods that allow complete control over page content?
Answer: The client-side document object
10
Which is the subset that transforms web content into secure modules that can be safely hosted on a web page?
Answer: dojox.secure
11
What will be the output of the following JavaScript code?
var set = new Set();
set.add("one");
set.add("two");
for (let elements of set)
{
document.writeln(elements+" ");
}
Answer: one two
12
What will be the output of the following JavaScript code?
set.add("AngularJS");
set.add("Bootstrap");
set.delete("Bootstrap");
document.writeln(set.size);
Answer: 1
13
What will be the output of the following JavaScript code?
set.add("one");
set.add("two");
set.add("three");
set.clear();
document.writeln(set.size);
Answer: 0
14
What will be the output of the following JavaScript code?
set.add("one");
set.add("two”);
var itr=set.values();
document.writeln(itr.next().value);
Answer: one
15
What will be the output of the following JavaScript code?
set.add("1");
set.add("2");
document.writeln(set.has("3"));
Answer: false