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 Object-Oriented JavaScript (2015) Constructor Functions and Prototypes Making the UI Work

I'm not getting the song list up in GUI like it does in the demo.

I'm not getting the song list up in GUI. Snapshot https://w.trhou.se/cg5et5knwz

any help much appreciated

Best

Tim

2 Answers

arash mansour
arash mansour
6,678 Points

tis is not correct. htmlString += 'class="current"';

and should be space between single quot and class, like this.

htmlString += ' class="current"';

Eric Hutchison
Eric Hutchison
4,791 Points

This was my exact problem! Good eye!

You made two mistakes:

  1. in the constructor function of playlist you wrote "this.song"(singular), but in the add function you wrote "this.songs"(plural).
  2. in the add function you don't have a parameter. Always remember to check the javsacript console , it will help you a lot when debugging some code.