Tell us what’s happening:
I am doing these javascript exercises but the problem is, the output does not show in the bottom-right console window.
And when i click the “Run the tests” button it ends the exercise and takes me to the next one without showing the output of the program.
How to view the output before clicking the Run the tests button?
Your code so far
// Declare your variable here
var myGlobal = 5;
function fun1() {
// Assign 5 to oopsGlobal Here
oopsGlobal = 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 6.1; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/global-scope-and-functions