Skip to content

Instantly share code, notes, and snippets.

View gabsprates's full-sized avatar
:shipit:
Focusing

Gabriel Prates gabsprates

:shipit:
Focusing
View GitHub Profile
{} + {} // NaN
({} + {}) // “[object Object][object Object]”
eval(‘{} + {}’) // NaN
eval(‘({} + {})’) // “[object Object][object Object]”
{} + {} // “[object Object][object Object]”
({} + {}) // “[object Object][object Object]”
eval(‘{} + {}’) // NaN
eval(‘({} + {})’) // “[object Object][object Object]”
var foo = new Object() // {}
foo.toString() // ‘[object Object]’
// Even to object
// that aren't empty
var bar = { lang: ‘js’, y: 94 }
foo.toString() // ‘[object Object]’
// The `join()` of an empty Array
// always will be an empty string
var foo = new Array() // []
foo.join() // “”
foo.toString() // “”
// If the Array have elements,
// we have an cool string.
var bar = [ 1, 2, 3, 4, 5 ]
+Infinity + (+Infinity) // Infinity
-Infinity + (-Infinity) // -Infinity
4 + 0 // 4
0 - 4 // -4
6 + 4 // 10
5 - 6 // -1
(-0) + 0 // 0
‘Java’ + ‘Script’ // “JavaScript”
‘JavaScript ‘ + 6 // “JavaScript 6”
6 + ‘ JavaScript’ // “6 JavaScript”
2015 + 6 // 2021
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.