-
-
Save drnugent/a7e99cd3b27580c6211e to your computer and use it in GitHub Desktop.
@getify MIN_VALUE exmple
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
[] == ![]; //true |
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
function foo() { | |
try { | |
return 2; | |
} | |
finally { | |
return 3; | |
} | |
} | |
foo(); // 3 <— wtf? where’s the 2? |
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
Number.MAX_VALUE > 0; //true | |
Number.MIN_VALUE < 0; //false |
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
Number({}); // NaN | |
Number([]); // 0 |
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
o1 = { hello: “world” }; | |
o2 = Object.create(null); | |
o2.hello = “world”; | |
o1 + “”; // “[object Object]” | |
o2 + “”; // TypeError! |
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
s = Symbol(“that’s cool”); | |
s; // Symbol(that’s cool) | |
String(s); // "Symbol(that’s cool)” | |
s + “”; // TypeError! |
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
{ | |
typeof a; // undefined | |
typeof b; // TDZ error! | |
// … | |
let b; | |
} |
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
42.toFixed(2); // Syntax Error | |
42. toFixed(2); // Syntax Error | |
42 .toFixed(2); // “42.00” | |
42 . toFixed(2); // “42.00” | |
42.0.toFixed(2); // “42.00” | |
42..toFixed(2); // “42.00” |
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
Number(“0.”); // 0 | |
Number(“.0”); // 0 | |
Number(“.”); // NaN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment