Javascript is proven to be hard

Tell us what’s happening:
i’m clueless as what to do

Your code so far


function myLocalScope() {
 'use strict';

 // Only change code below this line

 console.log('inside myLocalScope', myVar);
}
myVar;
myLocalScope();

// 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 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36 OPR/72.0.3815.186.

Challenge: Local Scope and Functions

Link to the challenge:

The instructions say

Declare a local variable myVar inside myLocalScope and run the tests.

But you have declared

outside of the function myLocalScope, and you did not use the correct syntax for declaring a variable.

1 Like

image

like this?

The ()s are not part of the syntax for declaring a variable.

When in doubt, you can go back and look at older lessons for reference:

1 Like

This is harder than i thought

Learning to code is very hard. Anyone can do it (barring some cognitive impairments I suppose), but it takes a lot of work.

1 Like