Last active
May 7, 2021 05:24
-
-
Save cmmartin/e54157d2b7e891a8512b to your computer and use it in GitHub Desktop.
Javascript lies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
null + null === 0 // true | |
[] + [] === '' // true | |
null + 1 === 1 // true | |
isNaN(null) // false | |
NaN === NaN // false | |
undefined == null // true | |
16.19 * 100 === 1619 // false | |
0.1 + 0.2 === 0.3 // false | |
typeof null === 'object' // true | |
// lisp? | |
var x = (Math.pow, 1, 1); x // 1 | |
document.all | |
// HTMLAllCollection[1045] | |
typeof document.all | |
// "undefined" | |
document.all === undefined | |
// false | |
3.5 * '18' // 63 | |
parseInt(0.00000000000434, 10) // 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment