DEV Community

loading...

Discussion on: What's the output? Hoisting question

Collapse
1qk1 profile image
Panagiotis Skarlas

Bruh this is scope, not hoisting.

(Also the answer is 5)

Collapse
318097 profile image
Mehul Lakhanpal Author

It is hoisting too. And the answer is 10

Collapse
1qk1 profile image
Panagiotis Skarlas

Oh wow. There is a reason var is deprecated haha. Sorry my friend, I'm an idiot.

Thread Thread
318097 profile image
Mehul Lakhanpal Author

No problem. Everyone was at situation once 😀