Online Marketing & Business Strategy

Ph: +91...4949
Email: info@hmi-tech.net

Quiz on Javascript If operator -- If(value) { A } else { B }

Number Question Answer Your answer
1 if ( [ 0 ] ) { A } else { B } 1 B
2 A
2 if ("0") { A } else { B } 1 A
2 B
3 if (B) { A } else { B } 1 A
2 B
4 if ("-1") { A } else { B } 1 B
2 A
5 if (-Infinity) { A } else { B } 1 B
2 A
6 if (undefined) { A } else { B } 1 B
2 A
7 if ("B") { A } else { B } 1 A
2 B
8 if ( [1] ) { A } else { B } 1 A
2 B
9 if ("") { A } else { B } 1 B
2 A
10 if (-1) { A } else { B } 1 B
2 A
Number Question Answer Your answer
11 if ("true") { A } else { B } 1 B
2 A
12 if (Infinity) { A } else { B } 1 A
2 B
13 if ( [ [ ] ] ) { A } else { B } 1 B
2 A
14 if (NaN) { A } else { B } 1 A
2 B
15 if (null) { A } else { B } 1 B
2 A
16 if ( { } ) { A } else { B } 1 A
2 B
17 if (0) { A } else { B } 1 A
2 B
18 if ( [ ] ) { A } else { B } 1 B
2 A
19 if ("1") { A } else { B } 1 A
2 B
20 if (true) { A } else { B } 1 A
2 B
Number Question Answer Your answer
21 if (1) { A } else { B } 1 A
2 B