I am trying to pass this level and have read all of the forums that others have posted and watched the videos but cannot get it right,
The only this that will not get checked off is “oppsGlobal should be a variable and have a value of 5”
// Declare the myGlobal variable below this line
let myGlobal = 10;
function fun1(oppsGlobal) {
// Assign 5 to oopsGlobal Here
oppsGlobal=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);
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Global Scope and Functions
Link to the challenge: