ibso2w
Last Updated: February 25, 2016
·
503
· phantom

Javascript Bizzars

var a = {a: 1};
var b = {a: 1};
a.prototype === b.prototype
true 

a === b
false

a + b
[object Object][object Object] String

a - b
NaN Not a number

Equality [] === []
false 

Equality [] === new Array()
false

Equality [] === {} 
false 

Equality {} === {}
false 

Equality {} === new Object()
false

Array Addition [1,2] + [1,3]
1,21,3 

Array  Subtraction [1,2] - [1,3]
NaN   
Not a number

Array + Object Addition [] + {}
[object Object]   
String

Object + Object Addition {} + {}
[object Object][object Object]
String

Subtraction [] - []
0
Number

Subtraction [] - {}
NaN
Not a number

Subtraction {} - {}
NaN  
Not a number