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 Objects Loop Through Objects Display an Array of Objects on the Page – One Solution

I learned a valuable lesson, go over your coding again and again.

I did the code correctly, but for some reason the message would only display the last rotation of the loop... I had no idea what was going on and was going mad because in my head the code was correct...but I was not getting the correct output... so I frustratingly watched Gill's vid on how he did it...turns out I was spot on with my coding but happen to forget the (+) when adding my string to the HTML= ' ' var... therefore it was not adding every loop rotation to the message and only giving me the final rotation (object). I had previously gave up on code last year due to this very lesson so I was so angry that even now, with much more understanding this time around, still couldnt figure it out. Turns out if I had just reviewed my code more closely I would have caught the easy fix. Im glad I have a much better understanding now.

1 Answer

josephpatrickpotot
josephpatrickpotot
18,010 Points

Welcome to the world of coding. Sometimes it really is better to get out, get a smoke, relax for a bit then go back to your code. Usually you would find the error with fresher eyes and mind than spend two to three hours looking for that damn semi-colon that's ruining your day.