Test your understanding of scope in JavaScript
@qs_by_qset
Created this 6 months ago
1. What is the difference between `var` and `let`?
2. What is the scope of a variable declared with the `import` keyword?
3. What is the scope of a variable declared in a method of a class?
4. What is the scope of a variable declared with `let`?
5. How can you prevent a variable from being accessed outside its scope?
6. What is the scope of a variable declared in a constructor function?
7. What is the scope of a variable declared with the `export` keyword?
8. What is the scope of a variable declared in an arrow function?
9. What is the scope of a variable declared with `var`?
10. What is the scope of a variable declared in a global context?
11. What is the scope of a variable declared in a class?
12. What is the scope of a variable declared in a callback function?
13. What is the difference between the `this` keyword and the `self` keyword?
14. What is the scope of a variable declared in a nested function?
15. What is the scope of a variable declared with `const`?
16. How can you create a private variable in JavaScript?
17. What is the scope of a variable declared in a module?
18. What is the difference between `let` and `const`?
19. How can you access a variable declared in an outer scope from a nested scope?