How it starts!

Image credit: thomashawk

How it starts!

Waleed Ashraf bio photo By Waleed Ashraf Share it!

Some weird JavaScript! It’s still <3

!![]       // -> true
[] == true // -> false

!!null        // -> false
null == false // -> false

[1, 2, 3] + [4, 5, 6]  // -> '1,2,34,5,6'

parseInt('f*ck');     // -> NaN
parseInt('f*ck', 16); // -> 15

1 < 2 < 3 // -> true
3 > 2 > 1 // -> false

 3  - 1  // -> 2
 3  + 1  // -> 4
'3' - 1  // -> 2
'3' + 1  // -> '31'

null > 0;  // false
null == 0; // false
null >= 0; // true
comments powered by Disqus