Last active
March 16, 2018 21:23
-
-
Save leobalter/e7f2fe51263b83a91b7f3e5cdf3ea05a to your computer and use it in GitHub Desktop.
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
Qual o resultado para: | |
// 1: | |
{}+{} // ? | |
// 2: | |
({}+{}) // ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
é o comportamento válido, de acordo com a especificação. O problema de verificar esse código no console do browser é que ele encapsula o código e o
{}
pode ser interpretado em posição de expressão, não de statement. Fazendo o valor sair diferente em alguns browsers. O mesmo acontece no node.