DEV Community

Discussion on: Summarizing Namaste 🙏 JavaScript EP03 (Hoisting)

Collapse
jamwal21 profile image
Abhinav Singh Jamwal Author

In case you guys are thinking variable declaration moves first or function declaration??
See this:

alert(abc);
var abc=10;
function abc(){console.log("Function declaration gets hoisted first");}
alert("Variable declaration gets hoisted after F.declaration");
alert(abc);