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 Loops, Arrays and Objects Simplify Repetitive Tasks with Loops For Loops

robiny
robiny
7,334 Points

Code won't run

I followed along in workspace, notated the same code as instructor and yet code is still not running in the preview? Help, please!

https://w.trhou.se/a8tv2psir5

1 Answer

Darryl Mah
Darryl Mah
5,492 Points

Double check your reference to the JS file. You have it pointing to the JS folder but that folder is empty. The .js file is actually in your home route. ;)

A helpful tip, for the future, If you look into your dev tools console should see an error that your code couldn’t find the file you were referring too.

Happy coding and keep learning! :)

robiny
robiny
7,334 Points

Thank you! :D Your right, I went into the folder, but lapsed and didn't check the file was existing IN the folder.