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 Tracking Multiple Items with Arrays Adding Data to Arrays

Alonso Lopez
Alonso Lopez
8,609 Points

I can't preview my whole code in Google Chrome. Only title appears, but not the list. No errors registered.

I think I copied exactly the same code but my browser (Google Chrome) does not show the list. When I checked the console there were no errors. I think the problem is probably my browser's version of some pluggin.

Here is my code :

var playList = []; playList.push('I Did It My Way'); playList.push('Respect', 'Imagine'); playList.unshift('Born to Run'); playList.unshift('Louie Louie'); printList ( playList );

Did you look for errors with "ctrl+shift+i"?

2 Answers

Gabriel GalΓ‘n
Gabriel GalΓ‘n
3,346 Points

Hi, there. The most probable mistake is that you made a typo when linking the helpers.js file to your html. This would explain why just the title shows up but not the list. If helpers.js wasn't properly linked, it means that the function call you did in playlist.js (which is printList(playlist)) would be invalid. Sorry for the late reply!

Hi Ethan, It looks like it was the printList call that was messing this up. Try it as a document.write and it will work just fine: var playList = []; playList.push('I Did It My Way'); playList.push('Respect', 'Imagine'); playList.unshift('Born to Run'); playList.unshift('Louie Louie'); document.write( playList ); Good luck! Carol