Global Scope and Functions Opps Global Placement?

Tell us what’s happening:
I do not understand what is happening here, I think I am understanding the instructions but I must be missing something easy here.

Your code so far


// Declare your variable here;
var myGlobal = 10;

function fun1() {
  // 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; rv:65.0) Gecko/20100101 Firefox/65.0.

Link to the challenge:

1 Like

Look very carefully at the name of your variable.

1 Like

Yeah just noticed, sorry about that, can be deleted if you want.

1 Like

You should add the variable var global = 10 in the function fun2()