Help Declare myGlobal

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

// Declare the myGlobal variable below this line

let 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 (Linux; Android 11; SM-A716U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.70 Mobile Safari/537.36

Challenge: Global Scope and Functions

Link to the challenge:

Hello there.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more information you give us, the more likely we are to be able to help.

I am assuming that you’re having trouble running your code;
There is a typo , you have typed oppsGlobal = 5 try changing it to, oopsGlobal = 5

1 Like

Thanks I have the answer now. Did not realize i misspelled oopsGlobal. Thanks for the help.

Welcome, i’m happy i was able to help…

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.