Untitled
Anonymous
Plain Text
10/28/2021 10:39 AM
452 B
17
Indexable
Never
// Declare the myGlobal variable below this line
let oopsGlobal;
let myGlobal;
function fun1() {
// Assign 5 to oopsGlobal Here
oopsGlobal = 5;
myGlobal = 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);
}Editor is loading...