Not getting it this at all

I believe I have the right setup, but I could be wrong. Please help.

  **Your code so far**
// Declare the myGlobal variable below this line
const myGlobal = 10;
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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36

Challenge: Global Scope and Functions

Link to the challenge:

Where is let for oppsGlobal? And you do not have to point myGlobal to 10 again.

@camperextraordinaire thank you. @madscience1 I added let to oppsGlobal . That checked off all but the last the : opps Global should should have the value of 5. almost there.

Please look at what I have. I added let to oopsGlobal and it checked off all but the oopsGlobal 5

Thank you for your input

   **Your code so far**
// Declare the myGlobal variable below this line
let myGlobal= 10

function fun1() {
 // Assign 5 to oopsGlobal Here
let 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/102.0.5005.61 Safari/537.36

Challenge: Global Scope and Functions

Link to the challenge:

I don’t understand the question. The let oppsGlobal = 5; is written and I added the let as you adviced and it made a big diffrence.

 I don't get;

oppsGlobal should be a global variable and have a value of

5

The in

Two problems:

Minor spelling error and:

Inside function fun1, assign 5 to oopsGlobal without using the let or const keywords.

You have to use let, just not inside fun1 .

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