myGlobal should be declared using the let or const keywords

Global Scope and Functions
need help

Please post your code as code and give a link to the challenge as well.


If you have a question about a specific challenge as it relates to your written code for that challenge, just click the Ask for Help button located on the challenge. It will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.


The test is telling you that the variable myGlobal should be declared using let or const.

// Declare the myGlobal variable below this line
let myGlobal = 10;

function fun1() {
// Assign 5 to oopsGlobal Here
oopsGlobal = 5;

}

// Only change code above this line

function fun2() {
var output = “”;
if (typeof myGlobal != “undefined”) {
output += "myGlobal: " + myGlobal;
}
if (typeof oopsGlobal != “undefined”) {
output += " oopsGlobal: " + oopsGlobal;
}
console.log(output);
}
Besides var, we should keep the let/const in the program