I Need Help this is my code so far
function myLocalScope() {
var myVar = 5;
console.log(myVar);
}
myLocalScope();
console.log('inside myLocalScope', myVar);
Please Help!
link to challenge:
Click This.
I Need Help this is my code so far
function myLocalScope() {
var myVar = 5;
console.log(myVar);
}
myLocalScope();
console.log('inside myLocalScope', myVar);
Please Help!
link to challenge:
Click This.
Don’t assign anything to the variable, just declare it.
You did it right, but keep the "console.log(‘inside myLocalScope’, myVar) " as it is to be able to console.log function myLocalScope().
function myLocalScope() {
‘use strict’;
// Only change code below this line
var myVar = 5;
console.log(‘inside myLocalScope’, myVar);
}
myLocalScope();
// Run and check the console
// myVar is not defined outside of myLocalScope
console.log(‘outside myLocalScope’, myVar);