Global Scope and Functions in JavaScript

Global Scope and Functions in JavaScript
0

#1

I am stuck in the topic: Global Scope and Functions in JavaScript…
“Inside function fun1, assign 5 to oopsGlobal without using the var keyword.” How is it done please? Thank you.

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

}


#2
oopsGlobal = 5;

#3

thanks Buddy, I over-thought it. I thought I needed to use the “console.log(…)” to assign the value.