var i = 5;
if(true){
var i = 10;
}
console.log(i);
Thanks for reading π
Follow @codedrops.tech for daily posts.
Instagram β Twitter β Facebook
Micro-Learning β Web Development β Javascript β MERN stack β Javascript
codedrops.tech
Top comments (4)
Bruh this is scope, not hoisting.
(Also the answer is 5)
It is hoisting too. And the answer is
10
Oh wow. There is a reason var is deprecated haha. Sorry my friend, I'm an idiot.
No problem. Everyone was at situation once π