Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

Modify the 'Car' constructor function so that it takes an argument for its model and set its 'model' to the model passed

Forgive me for asking on the forums, but I can't get this blasted question to be right.

'''function Car(model) { this.model = model; } '''

gives me Bummer! There was an error with your code: SyntaxError: Parse error could someone explain what it wants and how to get there?

2 Answers

lordcozycat
lordcozycat
11,940 Points

This should be the pass for Challenge Task 1 of 3:

function Car(model) {
        this.model = model;
      }

that worked thanks, why is it yours works, and mine errors?

lordcozycat
lordcozycat
11,940 Points

Not too sure about that. Parse error means you could have forgotten a semi-colon, added an extra character somewhere, or something else. Check out http://jslint.com/ to help you find errors, since Chrome/Firefox dev tools won't be of any use on Treehouse.

Oisin Kilkenny
Oisin Kilkenny
14,213 Points

Hello Andrew, could you give me the link to the challenge?

http://teamtreehouse.com/library/prototypes though I think that might be shortened