Javascript local scope

Tell us what’s happening:
I really don’t know what’s happening I’ve tried three ways but isn’t working may someone pleas help me on this one

Your code so far


function myLocalScope() {
'use strict';

// Only change code below this line
function myLocalScope() {
var myVar = 5;
console.log(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 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36.

Challenge: Local Scope and Functions

Link to the challenge:

It looks like you might have some sort of weird invisible character in your code. Click the ‘Reset All Code’ button to start fresh and the only thing you want to do is add the line declaring myVar right below the comment.

1 Like

you have the function sigbature twice, it was already written, you didn’t need to write it again