Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Amandeep Pasricha14,932 Points
Does the addEventListener function appear in the call stack, while its callback and 'click' appear on the right?
My question stems from the visual shown before, where async development was handled in an area outside the call-stack, so I want to know if I am imagining this correctly
Looking at the MDN documents if you search for 'EventTarget.addEventListener()' this method is listed under WEB APIs, so you could say that when you call this method, I guess it starts its cycle at the CallStack, jumps to Web APIs, the AJAX response gets pushed to the Callback Queue and eventually is processed and pushed by the Event Loop to the CallStack where it shows you the data the way you want it processed and it finishes it cycle.