Basic javascript And Variables MCQ question and answer – 04 Posted on June 17, 2020June 18, 2020 by admin 4 Created on June 17, 2020 By admin Basic javascript And Variables MCQ question and answer - 04 1 / 10 1. The output for the following code snippet would most appropriately bevar a=5 , b=1var obj = { a : 10 }with(obj) { alert(b)} A. 10 B. Error C. 1 D. 5 2 / 10 2. The output for the following code snippet would most appropriately bevar a=5 , b=1var obj = { a : 10 }with(obj) { alert(b)} A. 10 B. Error C. 1 D. 5 3 / 10 3. A conditional expression is also called a A. Alternate to if-else B. Immediate if C. If-then-else statement D. None of the mentioned 4 / 10 4. Which is a more efficient code snippet ?Code 1 :for(var num=10;num>=1;num--){ document.writeln(num);}Code 2 :var num=10;while(num>=1){ document.writeln(num); num++;} A. Code 1 B. Code 2 C. Both Code 1 and Code 2 D. Cannot Compare 5 / 10 5. A statement block is a A. conditional block B. block that contains a single statement C. Both conditional block and single statement D. block that combines multiple statements into a single compound statement 6 / 10 6. When an empty statement is encountered, a JavaScript interpreter A. Ignores the statement B. Prompts to complete the statement C. Throws an error D. Throws an exception 7 / 10 7. The “var” and “function” are A. Keywords B. Declaration statements C. Datatypes D. Prototypes 8 / 10 8. Consider the following statementsswitch(expression){ statements}In the above switch syntax, the expression is compared with the case labels using which of the following operator(s) ? A. == B. equals C. equal D. === 9 / 10 9. Consider the following statementsvar count = 0;while (count < 10) { console.log(count); count++;}In the above code snippet, what happens? A. The values of count is logged or stored in a particular location or storage B. The value of count from 0 to 9 is displayed in the console C. An error is displayed D. An exception is thrown 10 / 10 10. The enumeration order becomes implementation dependent and non-interoperable if : A. If the object inherits enumerable properties B. The object does not have the properties present in the integer array indices C. The delete keyword is never used D. Object.defineProperty() is not used Your score is The average score is 28% LinkedIn Facebook Twitter 0% Restart quiz