Basic Javascript: Local Scope and Functions

Basic Javascript: Local Scope and Functions
0

#1

can’t get it

function myLocalScope() {

'use strict'; // you shouldn't need to edit this line

var myVar = "5";

console.log(myVar);

}

myTest ();

myLocalScope();

// Run and check the console

// myVar is not defined outside of myLocalScope

console.log(myVar);

// Now remove the console log line to pass the test


#2

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/local-scope-and-functions


#3

What is this? That is not necessary.


#4

@yoelvis i tried taking it away. doesn’t solve the problem


#5

Follow this instruction too.


#6

thanks. learning to read one day at a time :man_student: