Declare the myGlobal variable below this line

Declare the myGlobal variable below this line

Declare the myGlobal variable below this line


// Declare the myGlobal variable below this line
var myGlobal = 10

var oopsGlobal = 5

function fun1() {

}

// 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 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0.

Challenge: Global Scope and Functions

Link to the challenge:

Do you have a question?