Skip to content

Instantly share code, notes, and snippets.

@bernardobrezende
Created October 26, 2016 00:03
Show Gist options
  • Save bernardobrezende/d59150f9d711b2a2665ef69dce9859d0 to your computer and use it in GitHub Desktop.
Save bernardobrezende/d59150f9d711b2a2665ef69dce9859d0 to your computer and use it in GitHub Desktop.
0.1 + 0.2 // 0.30000000000000004
'2' == 2 // true
true + true // 2
true + true - true // 1
999999999999999 // 999999999999999
9999999999999999 // 10000000000000000
typeof 0.3 // 'number'
0/0 // NaN
0/0 == 0/0 // false
NaN == NaN // false
typeof NaN // 'number'
isNaN(0/0) // true
1/0 // Infinity
typeof [] // 'object'
[] instanceof Object // true
[].constructor // function Array() { }
typeof null // 'object'
null instanceof Object // false
[] + [] // ""
[] + {} // "[object Object]"
{} + [] // 0
1/+[] // Infinity
{} + {} // "[object Object][object Object]"
Array(10) // [ undefined x 10 ]
Array(10).join('js') // "jsjsjsjsjsjsjsjsjs"
1 + 2 + 3 // 6
1 + 2 + '3' // '33'
1 + '2' + 3 // '123'
Array(10).join('JS' + 1) // "JS1JS1JS1JS1JS1JS1JS1JS1JS1"
Array(10).join('JS' - 1)
'2' == 2 // true
[2] == '2' // true
[2] == 2 // true
[] == ![] // true
[] == [] // false
'2' - -1 // 3
'2' === 2 // true
[2] === '2' // true
[2] === 2 // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment