Instruction
- Total number of questions : 20.
- Time alloted : 20 minutes.
- Each question carry 1 mark.
- No Negative marks
- DO NOT refresh the page.
- All the best :-).
1. |
The main purpose of a “Live Wire” in NetScape is to |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: A Live Wire database driver also supports a number of non-relational databases. |
2. |
The type of a variable that is volatile is |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: The variables whose values can be changed are called mutable variable types. |
3. |
A function definition expression can be called |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: a function definition expression is a “function literal” in the same way that an object initializer is an “object literal.” A Function definition expression typically consists of the keyword function followed by a comma-separated list of zero or more identifiers (the parameter names) in parentheses and a block of JavaScript code (the function body) in curly braces. |
4. |
The output for the following code snippet would most appropriately be var a=5 , b=1 var obj = { a : 10 } with(obj) { alert(b) } |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: The interpreter checks obj for property b, fails and takes it from outside of with. |
5. |
What are the three important manipulations done in a for loop on a loop variable? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: In a for loop, the initialization, the test, and the update are the three crucial manipulations of a loop variable. |
6. |
The object has three object attributes namely |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: Every object has three associated object attributes : |
7. |
Consider the following code snippet var a1 = [,,,]; var a2 = new Array(3); 0 in a1 0 in a2 The result would be |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: a1 has an element with index 0 and a2 has no element with index 0. |
8. |
Consider the following code snippet function printprops(o) { for(var p in o) console.log(p + ": " + o[p] + "\n"); } What will the above code snippet result ? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: The above code snippet returns undefined. |
9. |
Do functions in JavaScript necessarily return a value ? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: None. |
10. |
What must be done in order to implement Lexical Scoping? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: In order to implement lexical scoping, the internal state of a JavaScript function object must include not only the code of the function but also a reference to the current scope chain. |
11. |
The keyword or the property that you use to refer to an object through which they were invoked is |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: The ‘this’ keyword is used to refer to the object through which the properties or methods were invoked. This use of ‘this’ is a fundamental characteristic of the methods of any class. |
12. |
The properties of the objects act like different kinds of class members. They are |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: In JavaScript, there are three different objects involved inany class definition, and the properties of these three objects act like different kinds of class members namely, Constructor object, Prototype object, and Instance object. |
13. |
The maximum number of global symbols a module can define is |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: Generally, the various modules are allowed to run in the pristine (or near pristine) environment that it expects. The modules should minimize the number of global symbols they define – ideally, no module should define more than one. |
14. |
Consider the following statement containing regular expressions var text = "testing: 1, 2, 3";In order to check if the pattern matches, the statement is |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: The given pattern is applied on the text given in the paranthesis. |
15. |
Why does JavaScript subset disallow == and !=? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: The subset does not include the comma operator, the bitwise operators, or the ++ and — operators. It also disallows == and != because of the type conversion they perform, requiring use of === and !== instead. |
16. |
The let keyword can be used |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: The let keyword can be used in four ways : |
17. |
Consider the following code snippet data.sort(function(a,b),b-a);What does the above code do? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: The above code snippet sorts an array in reverse numerical order. |
18. |
What is the function used to deregister event handler ‘f’? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: The removeListeners(name,f) is used to deregister event handler f represented as : |
19. |
Which of the following are global functions that are not part of core JavaScript? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: The spawn(f) runs f() or loads and executes file f in a new thread. |
20. |
Why does the Node rely on event handlers? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: Because the APIs are asynchronous, Node relies on event handlers, which are often implemented using nested functions and closures. |