function myLocalScope() {
'use strict';
// Only change code below this line
console.log('inside myLocalScope', myVar);
}
myLocalScope(
var "myVar");
// Run and check the console
// myVar is not defined outside of myLocalScope
console.log('outside myLocalScope', myVar);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0.
What question? You don’t understand the information in the course?
Variables which are declared within a function, as well as the function parameters have local scope. That means, they are only visible within that function.
This means if, in your program, you declare const number = 1, the variable number will be accessible from anywhere in your code.
If you do something like declare function numbercounter(), and you declare const number = 1inside the function, only this function will ever be able to interact with that variable.