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 JavaScript Basics (Retired) Introducing JavaScript Your First JavaScript Program

i checked the order that the programme runs on my site. why the 2nd command run after the 1st and 3rd commands complete?

the teacher mentioned in the video that the command would run one after the other right?

2 Answers

Antony .
Antony .
2,824 Points

This is because the behavior of browsers have changed how they handle loops just across the board.

To make things a little more clear and concise, this isn't your fault. It's the browsers. The browsers behavior has changed since the video was uploaded. So in your case, any alert function that gets placed will print out first.

https://teamtreehouse.com/community/hi-it-doesnt-behave-like-in-the-video-n-list-comes-out-only-once-quit-is-entered-how-to-solve-this-issue-so-it-works

thank you.

Robert O'Toole
Robert O'Toole
6,366 Points

thanks! how can we override this?