Created
February 1, 2019 20:57
-
-
Save thisismydesign/298cabef78acf8796ea29874e73fb394 to your computer and use it in GitHub Desktop.
JavaScript is not a language
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
// https://codeburst.io/javascript-null-vs-undefined-20f955215a2 | |
// With default parameters, `null` does not use default parameters | |
let logDefault = (str = 'default') => { | |
console.log(str); | |
} | |
logHi(); | |
// => hi | |
logHi(undefined); | |
// => hi | |
logHi(null); | |
// => null | |
// https://codeburst.io/javascript-null-vs-undefined-20f955215a2 | |
// `null` is a primitive with an object type | |
typeof null | |
// => "object" | |
// https://www.destroyallsoftware.com/talks/wat | |
[] + [] | |
// => "" | |
// https://www.destroyallsoftware.com/talks/wat | |
[] + {} | |
// => "[object Object]" | |
{} + [] | |
// => 0 | |
{} + {} | |
// => NaN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment