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 trialGrace Ji
5,402 PointsHow could the function Playlist work without properties?
at 03:37 on this video, he adds this.songs = []; and this.nowPlayingIndex = 0; but function Playlist doesn't have any property in its parenthesis. How could the function Playlist work without properties in its parenthesis?
1 Answer
Grace Ji
5,402 PointsThank you Tim! It was a huge help!!!!!!!!
Tim Strand
22,458 PointsTim Strand
22,458 Pointsi think what you are asking is how can he call Playlist() without any parameters? you dont have to define parameters for a function object to be called. the functions properties are what he is setting by defining this.songs (songs is a property) and this.nowPlayingIndex (also a property of this which is the current instance of Playlist function object.