Instruction
- Total number of questions : 10.
- Time alloted : 10 minutes.
- Each question carry 1 mark.
- No Negative marks
- DO NOT refresh the page.
- All the best :-).
1. |
The basic difference between JavaScript and Java is |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: The basic difference between JavaScript and Java is that the functions are values, and there is no hard distinction between methods and fields. |
2. |
Which are usually variables that are used internally in object methods and also are globally visible variables? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: The variable properties are usually variables that are used internally in the objects methods, but can also be globally visible variables that are used through the page. |
3. |
The scope of a function is also called as |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: The scope of a function can be used as a private namespace for a module. Therefore, the scope of a function is called a module function. |
4. |
What does /[^(]* regular expression indicate ? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: We should always be careful while using * and ? as repetition characters as they may match zero instances of whatever precedes them, they are allowed to match nothing. |
5. |
Why was “The Good Parts” designed as a language subset in JavaScript? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: The Good Parts is a language subset designed for aesthetic reasons and with a desire to improve programmer productivity. There is a larger class of subsets that have been designed for the purpose of safely running untrusted JavaScript in a secure container or “sandbox”. |
6. |
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 ? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: The above code returns 1,4,9,16,25 which is the square of the first five natural numbers. Notice the usage of let keyword in the above code snippet. |
7. |
When will the finally block be called? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: A finally block is called after try-catch execution. |
8. |
Which function is a synonym for on()? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: The on() method is used for registering handlers. addListener() is a synonym for on(). |
9. |
Which Rhino command quits Rhino environment? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: The quit() command makes Rhino exit. |
10. |
What is the alternative command used in Node for load()? |
|||||||||||||||||||
|