Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function funcao() {
- // escopo de função
- var x = 1;
- let y = 2;
- const z = 3;
- {
- var x = 10; // conseguimos sobreescrever o valor
- // escopo de bloco
- let y = 20;
- const z = 30;
- console.log(x); // 10
- console.log(y); // 20
- console.log(z); // 30
- }
- console.log(x); // 10
- console.log(y); // 2
- console.log(z); // 3
- }
- funcao();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement