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 trialEdmund Southgate
12,056 PointsSo far as I can make out this should work however it's telling me that playlist.add() is not a function.
Steven Parker
231,275 PointsThat's a private URL to your workspace, it's temporary and only exists while you are using it.
But you can use the snapshot function in the workspace and provide the link to that.
Edmund Southgate
12,056 PointsI actually worked it out. It was as simple as playList instead of playlist. Thanks for the input though.
Steven Parker
231,275 PointsCool, so I actually did guess it! And congratulations on resolving it.
3 Answers
Steven Parker
231,275 PointsPerhaps a bad value in "playlist"?
Without seeing the code, this is just a guess, but maybe when this error occurs the "playlist" variable does not actually contain a Playlist object. Perhaps it has undefined or null?
christian gamboa
10,097 Pointsmake sure it looks like this:
// this prototype function receives a 'song' value
Playlist.prototype.add = function(song) {
this.songs.push(song);
};
Thomas Faller
9,640 PointsCan you check that you have playlist.add(.... in app.js and not Playlist.add(... ?
Timothy Schmidt
4,806 PointsTimothy Schmidt
4,806 PointsThe workspace link is broken