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 What is Asynchronous Programming? The Callback Queue and Event Loop

Why does it loop? I don't see any code that makes it loop

Why does it loop? I don't see any code that makes it loop

Dane Parchment
Dane Parchment
Treehouse Moderator 11,077 Points

Can you add some more clarification to your statement? What exactly here is looping? Are you talking about the Event Loop itself? Or the fact that the calling func1 provides outputs everything for func1, func2, and func3? Some more clarification here would be helpful.

1 Answer

Michael Rushton
Michael Rushton
7,126 Points

If I've understood the document correctly I think the reason you don't see any loops is because the event loop is just a built in part of the runtime environment. So it's doing all the "looping" as it continually checks the call back queue for tasks and also checks the call stack to see when it is empty and it can insert one of the tasks into it. I think it's just a part of the runtime environment that doesn't need to be invoked by any javaScript.