Created
August 5, 2013 20:37
-
-
Save marciojrtorres/6159391 to your computer and use it in GitHub Desktop.
Na linguagem Javascript os tipos são pós-definidos
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
num = 32; // ok, a variável num está de tipo number e tem o valor 32 | |
num = 98; // ok, a variável tem o valor 98 e ainda é do tipo number | |
document.write(typeof(num)); // imprime number | |
num = "texto"; // ok! agora num está de tipo string e tem o valor "texto" | |
document.write(typeof(num)); // imprime string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment