---
# System prepended metadata

title: Hoisting

---

# Hoisting


https://www.educba.com/ui-developer-interview-questions/  

Q.Explain what is event bubbling and event capturing?

Ans: event bubbling :agra koi div ke ander koi button hai tab button per jo event lagti hai wo div per bhi lag jayegi
isko stop karne ke liye hum button pe stop propagation laga dete hai tab button ki event sirf button per lagegi
div per nahi.
event capturing: ye event bubbling ke opposite hoti hai.
agra koi div ke ander koi button hai tab div per jo event lagti hai wo button per bhi lag jayegi
isko stop karne ke liye hum div pe stop propagation laga dete hai tab div ki event sirf div per lagegi
button per nahi.


Q.JavaScript Hoisting

Ans:x = 5; // Assign 5 to x


document.getElementById("demo").innerHTML = x; 

var x; // Declare x

javascript compiler var declare ko compile karke pehle kar deta hai 