What is the scope of a variable declared using the var keyword inside a function?
- Global scope
- Function scope
- Block scope
- Local scope
In JavaScript, a variable declared using the var keyword inside a function has function scope. This means it is accessible within the entire function but not outside of it. Unlike let and const, var does not have block scope.
Loading...
Related Quiz
- The ______ command can be used to update the package.json file to match the actual versions installed in the node_modules directory.
- Why is caching used in web applications?
- How can you import a specific item from a module in ES6+?
- The Buffer.isBuffer(obj) method in Node.js is used to determine if an object is a ______.
- What happens to the Event Loop when the callback queue and the task queue are both not empty?