Online Marketing & Business Strategy

Ph: +1(201)55_88_600
Email: mosh+info@hmi-tech.net

Quiz on Javascript Equality of Objects

Number Question Answer Your answer
1 ({ valueOf: function () { return '1' } }) == true 1 true
2 false
2 false == 0.1 1 true
2 false
3 ({ valueOf: function () { return 1 } }) == 1 1 false
2 true
4 false == null 1 true
2 false
5 [ ] == [ ] 1 false
2 true
6 [ ] == +[ ] 1 false
2 true
7 true == 1 1 true
2 false
8 false == 000 1 false
2 true
9 false == [0] 1 false
2 true
10 true == 4 1 false
2 true
Number Question Answer Your answer
11 false == '0' 1 false
2 true
12 false == 0 1 true
2 false
13 undefined == undefined 1 true
2 false
14 false == undefined 1 true
2 false
15 true == '1' 1 false
2 true
16 false == 4 1 true
2 false
17 null == undefined 1 false
2 true
18 ({ toString: function () { return 4 } }) == 4 1 true
2 false
19 obj1a = obj1b = {} ; obj1a == obj1b 1 false
2 true
20 null == null 1 true
2 false
Number Question Answer Your answer
21 false == false 1 false
2 true
22 false == 'hi' 1 true
2 false
23 null == true 1 true
2 false
24 false == [ ] 1 false
2 true
25 false == '000' 1 true
2 false
26 null == false 1 false
2 true
27 true == 'hi' 1 true
2 false
28 false == [ [ ] ] 1 false
2 true
29 false == '' 1 true
2 false
30 obj1a = obj1b = {} ; obj2 = {} ; obj1a == obj2 1 true
2 false
Number Question Answer Your answer
31 0 == [0] 1 true
2 false
32 ({ valueOf: function () { return 1 } }) == 0 1 false
2 true