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

Displaying an array of objects displays nothing...

Any ideas why this doesn't work? It doesn't throw any error codes. It seems like the browser isn't recognizing directory.js, but I don't know why. I've tried it in Notepad++ and workspaces, and the same thing happens both places. Thank you in advance for any help!

Here's the snapshot:

https://w.trhou.se/mixtn88xum

2 Answers

You have a typo in your index.html file, <script scr="js/directory.js"></script>.

Edit: Also for this line in your directory.js file, for (let i=0, i<pets.length, i++) {, you have to separate them with semicolons, not commas.

Thank you, Joseph. I feel very dense right now. I had been over that line probably 100 times, and didn't see those letters mixed up.
Thank you, also, for finding my next mistake before I had to look for it! The website is works now, finally!

Have a great day!