Tell us what’s happening:
I’ve passed the challenge and output in the console was: myGlobal: 10 oopsGlobal: 5
But when I tried the same code on the editor for other challenges or other online JS editor, there was nothing on the output. May I know why? Does this specific challenge has some hidden settings?
**Your code so far**
var myGlobal = 10
function fun1() {
oopsGlobal = 5
}
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/92.0.4515.159 Safari/537.36 Edg/92.0.902.78