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 trialStu Cowley
26,287 PointsNo Idea What To Do
Hey guys,
So I am really, really stuck on the first part of the Prototypes Code Challenge. In a nutshell I don't know what to do...
Modify the 'Car' constructor function so that it takes an argument for its model and set its 'model' to the model passed in from the argument.
Thanking you in advance
Stu :D
3 Answers
Russell Wood
12,088 PointsHey Stu,
I think that what the question is asking for is, given a function:
``` function Car() {
}```
that will take a "model" of Car as an argument:
function Car(model) {
to set (assign) the "model" (arg) taken, as the "model" (property of the constructor):
function Car(model) {
this.model = model;
}
I hope that helps (and I apologize for all the parens ).
Stu Cowley
26,287 PointsHey Russell,
Thanks heaps for that, I got it running perfectly thanks to your well written help!
Stu :D
Russell Wood
12,088 PointsGlad to help. Good luck with the rest.