Skip to content

Instantly share code, notes, and snippets.

@marciojrtorres
Created August 5, 2013 20:37
Show Gist options
  • Save marciojrtorres/6159391 to your computer and use it in GitHub Desktop.
Save marciojrtorres/6159391 to your computer and use it in GitHub Desktop.
Na linguagem Javascript os tipos são pós-definidos
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