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 trialDan Neumann
Courses Plus Student 10,318 PointsJavascript Foundations 3rd Challenge task
In the prototype section in the 3rd challenge task, I put:
function Car(model) { carPrototype.model = model; }
Car.prototype = carPrototype;
Car.prototype.wheels = "4";
and it returned Car.prototype.wheels was undefined not "4". Any ideas as to what I did wrong?
3 Answers
Hugo Paz
15,622 PointscarPrototype.wheels = 4;
Andrew Shook
31,709 PointsYes, the problem is that you are using the old car prototype and not the one you established in step two of the challenge. Also, you need to set the number of wheel to a number and not a string. Hope this helps, if you need more of an explanation just let me know
Dan Neumann
Courses Plus Student 10,318 PointsThat was it, thanks so much.