Created
June 15, 2022 10:09
-
-
Save ribafs/af410f9b0e00570e03c757efcbf064d7 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
<script> | |
// Recomenda-se atualmente usar somente o let, mesmo para variáveis locais. Veja estes dois pequenos exemplos | |
let minhaVar = 'global' | |
for(c=0;c<2;c++){ | |
let minhaVar= 'local'// Criada localmente no for | |
alert(minhaVar) | |
} | |
alert('Glo: '+minhaVar) | |
</script> | |
<script> | |
let minhaVar = 'global' | |
for(c=0;c<2;c++){ | |
alert(minhaVar) | |
} | |
alert('2: '+minhaVar) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment