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. |
JavaScript can be written |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: None |
2. |
The snippet that has to be used to check if “a” is not equal to “null” is |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: The not-equal operator !== compares o to null and evaluates to either true or false. |
3. |
Among the following, which one is a ternary operator? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: JavaScript supports one ternary operator, the conditional operator ?:, which combines three expressions into a single expression. |
4. |
Consider the following statements switch(expression) { statements } In the above switch syntax, the expression is compared with the case labels using which of the following operator(s) ? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: When a switch executes, it computes the value of expression and then looks for a case label whose expression evaluates to the same value (where sameness is determined by the === operator). |
5. |
Consider the following code snippet while (a != 0) { if (a == 1) continue; else a++; } What will be the role of the continue keyword in the above code snippet? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: Instead of exiting a loop like the break keyword, the continue keyword moves to the next iteration from the place encountered. |
6. |
The purpose of extensible attribute is to |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: The purpose of the extensible attribute is to be able to “lock down” objects into a known state and prevent outside tampering. |
7. |
The primary purpose of the array map() function is that it |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: The map() method passes each element of the array on which it is invoked to the functionyou specify, and returns an array containing the values returned by that function. |
8. |
Which of the following is the correct code for invoking a function without this keyword at all, and also too determine whether the strict mode is in effect? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: The above code defines and invokes a function to determine if we’re in strict mode. |
9. |
What is the difference between the two lines given below ? !!(obj1 && obj2); |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: None. |
10. |
What is the opposite approach to the lexical scoping? |
|||||||||||||||||||
|