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
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
For further actions, you may consider blocking this person and/or reporting abuse
xavier2code -
xavier2code -
Lithe -
Jaime -
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 😀