Global Scope and Functions I am stuck

Tell us what’s happening:

Your code so far

// Declare your variable here

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

// Only change code above this line
function fun2() {
  var output = "";
  if (typeof myGlobal != "undefined") {
    output += "myGlobal: " + myGlobal;
  if (typeof oopsGlobal != "undefined") {
    output += " oopsGlobal: " + oopsGlobal;

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36.

Link to the challenge:

What’s your issue with this? Can you write a bit more? What have you tried? What you don’t understand?


I would highly suggest you read the instructions again. It does not seem you have made any attempt to tackle the challenge. Below are the instructions for this challenge:

Using var , declare a global variable myGlobal outside of any function. Initialize it with a value of 10 .

Inside function fun1 , assign 5 to oopsGlobal without using the var keyword.