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! While you're at it, check out some resources Treehouse students have shared here.

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

JavaScript Asynchronous Programming with JavaScript Asynchronous JavaScript with Callbacks Async Programming and Callback Functions

Does the addEventListener function appear in the call stack, while its callback and 'click' appear on the right?

.

1 Answer

Sheila Anguiano
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Sheila Anguiano
Full Stack JavaScript Techdegree Graduate 35,239 Points

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.