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 trialJason Larkin
13,970 PointsObjects Car Prototype Number of Wheels
I am having a hard time with the third part of this challenge. What am I doing wrong? When I add the number of wheels to the carPrototype it invalidates the first problem. Can anyone help me please?
<script>
var carPrototype = {
model: "generic",
currentGear: 0,
increaseGear: function() {
this.currentGear ++;
},
decreaseGear: function() {
this.currentGear--;
}
}
function Car(model) {
this.model = model
}
Car.prototype = carPrototype;
wheels: 4;
</script>
2 Answers
Jeremy Faith
Courses Plus Student 56,696 PointsTry Car.prototype.wheels = 4;
Jason Larkin
13,970 PointsThank you, it worked!