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 trialHarris Keka
Courses Plus Student 3,611 Pointsid & dropped omitted.
Why did she omit the 'id' and 'dropped' parameters?
1 Answer
Steven Parker
231,248 PointsThere's an error in the video. At the bottom of the page, on the "Teacher's Notes" tab, there is an explanation with revised code under the heading "Code Correction".
Carlos Chavez
5,691 PointsCarlos Chavez
5,691 PointsActually, there's no answer for this on the "Teacher's Notes", and the dropped property is not clear to me yet.
The id of the token is generated by inserting an index and appending the and id which we will take from the owner. So that I get.
But why is there no 'dropped' argument passed to the token constructor? only owner and index.
Steven Parker
231,248 PointsSteven Parker
231,248 PointsNo argument is needed for the "dropped" attribute because the initial value of "dropped" is always "false":
this.dropped = false; // as set in the constructor