Three phases of event propagation are :- 1) Event Capturing :- Event capturing occurs when the event moves all the way down the elements from the top(The window object) to the event target 2)Target Phase :- this the phase when the event.target element is reached or found 3) Event Bubbling:- In this phase the event first triggers on the innermost target element, and then successively triggers on the parents of the target element Q2:- 1 Undefined 2 Here it is an IFEE so the function is called immediately in try an error is thrown and catch block runs here we calture the error in x and assign it to 1 so in catch block console.log(x) will give 1 then catch block is over and in next console.log(x) it will give undefined because the x will be 1 in catch block scope , then the third console.log(y) will give 2 because in catch block y is assigned to 2 it doesn't find y in its scope so it looks to lexical environment and found variable y and assign 2 to it So the output will be 1 undefined 2
Three phases of event propagation are :-
1) Event Capturing :- Event capturing occurs when the event moves all the way down the elements from the top(The window object) to the event
target
2)Target Phase :- this the phase when the event.target element is reached or found
3) Event Bubbling:- In this phase the event first triggers on the innermost target element, and then successively triggers on the parents of the target element
Q2:-
1
Undefined
2
Here it is an IFEE so the function is called immediately in try an error is thrown and catch block runs here we calture the error in x and assign it to 1 so in catch block console.log(x) will give 1 then catch block is over and in next console.log(x) it will give undefined because the x will be 1 in catch block scope , then the third console.log(y) will give 2 because in catch block y is assigned to 2 it doesn't find y in its scope so it looks to lexical environment and found variable y and assign 2 to it
So the output will be
1
undefined
2
That's correct. Please share your address on LinkedIn where you would like to receive your giveaway gift.
Mam make a video ABT reverse no , string in js.. find duplicate no or char . Find how many duplicate and remove them
Belated Happy Teacher's day mam, got to know how resourceful this channel is
Happy teachers day nd please do more videos on map and filter and reduce
Happy Teachers Day Mam..... I Hope this channel gets millions of Suscribers as soon as Possible!!!
Thanks Rahul 🤝
Happy teachers day mam
Hpy teachers day
Happy Teacher's Day 🙏🏻😊
Thanks Raj