ES6 - Compare Scopes of the var and let Keywords

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**
function checkScope() {
let i = 'function scope';
if (false) {
  i = 'block scope';
  console.log('Block scope i is: ', i);
}
else if (true) {
i= 'funtion scope'; 
console.log(checkScope);
return i;
}
}
console.log(checkScope());
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36

Challenge: ES6 - Compare Scopes of the var and let Keywords

Link to the challenge:

1 Like

First, please ask questions.

Secondly:

i= 'funtion scope'; 

Speling is important. :wink:

1 Like

Also, I’m not sure what you expect that code to do. It will never run.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.