Created
February 24, 2012 13:04
-
-
Save herberthamaral/1900797 to your computer and use it in GitHub Desktop.
wtf.js
This file contains hidden or 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
console.log(999999999999999) | |
//999999999999999 | |
console.log(9999999999999999) | |
//10000000000000000 ==> WTF?? | |
console.log(9999999999999999+1) | |
//10000000000000000 | |
console.log(9999999999999999+2) | |
//10000000000000002 ==> WTF^2?? | |
console.log(false || 'http') | |
//http | |
console.log(true || 'http') | |
//true | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
É um dos perigos de se usar short-circuit em js, pq é a característica de truthy/falsy do valor que é considerada.