Tell us what’s happening:
Describe your issue in detail here.
I originally attempted the problem on my own. However, I kept on running into the same issue. The code is continually failing the last check. "checkScope()
should return the string function scope
". I thought it was maybe something I did, so I used the hint and copied/paste their code. The same problem is happening. Is this a bug?
**Your code so far**
/*
function checkScope() {
"use strict";
let i = 'function scope';
if (true) {
let i = 'block scope';
console.log('Block scope i is: ', i);
}
console.log('Function scope i is: ', i);
return i;
}
*/
function checkScope() {
"use strict";
let i = "function scope";
if (true) {
let i = "block scope";
console.log("Block scope i is: ", i);
}
console.log("Function scope i is: ", i);
return i;
}
checkScope()
console.log(i)
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.106 Safari/537.36
Challenge: Compare Scopes of the var and let Keywords
Link to the challenge: