Test goals are ignored

Tell us what’s happening:
The last goal of the test states:
oopsGlobal should be a global variable and have a value of 5

The correct answer for the test is to give oopsGlobal a value of 5 in the fun1() function. This does not satisfy the last goal, as this is not a “global” variable as described and demonstrated in the previous lessons.

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

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

oopsGlobal is not a “global” variable in this solution.

  **Your browser information:**

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

Challenge: Global Scope and Functions

Link to the challenge:

I think you missed this sentence in the instructions:

Variables which are declared without the let or const keywords are automatically created in the global scope.

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