function myLocalScope() {
'use strict';
// Only change code below this line
console.log('inside myLocalScope', myVar);
}
myLocalScope();
// Run and check the console
// myVar is not defined outside of myLocalScope
console.log('outside myLocalScope', myVar);
You made changes to the starter code above the comment // Only change code below this line. When you change code that you were asked not to change, this can cause the test suite to fail.
When you enter a code block into a forum post, you precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
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);