1. How can you create a private variable in JavaScript using closures?

Wrong

2. What is the 'lexical scope' in JavaScript?

Wrong

3. What is a closure in JavaScript?

Wrong

4. What is the difference between global scope and local scope in JavaScript?

Wrong

5. What is the scope of a variable in JavaScript?

Wrong

6. Consider the following code: 'function outer() { let x = 10; function inner() { console.log(x); } return inner; } let closureFunc = outer(); closureFunc();'. What will be logged to the console?

Wrong

7. What happens if you try to access a variable outside its scope in JavaScript?

Wrong

8. What is the result of the following code: 'let a = 5; function example() { let a = 10; console.log(a); } example(); console.log(a);'

Wrong

9. How does a closure help with encapsulation in JavaScript?

Wrong

10. How can you avoid variable name conflicts in JavaScript?

Wrong

Result: