Basic javascript And Variables MCQ question and answer – 04

4
Created on By admin

Basic javascript And Variables MCQ question and answer - 04

1 / 10

1. The output for the following code snippet would most appropriately be
var a=5 , b=1var obj = { a : 10 }with(obj) {      alert(b)}

 

2 / 10

2. The output for the following code snippet would most appropriately be
var a=5 , b=1var obj = { a : 10 }with(obj) {      alert(b)}

 

3 / 10

3. A conditional expression is also called a

 

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++;}

 

5 / 10

5. A statement block is a

 

6 / 10

6. When an empty statement is encountered, a JavaScript interpreter

 

7 / 10

7. The “var” and “function” are

 

8 / 10

8. 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) ?

 

 

9 / 10

9. Consider the following statements
var count = 0;while (count < 10) {     console.log(count);     count++;}

In the above code snippet, what happens?

 

 

10 / 10

10. The enumeration order becomes implementation dependent and non-interoperable if :

 

Your score is

The average score is 28%

0%

Leave a Reply

Your email address will not be published. Required fields are marked *