Make Instances of Objects with a Constructor Function help

Make Instances of Objects with a Constructor Function help
0.0 0

#1

Tell us what’s happening:

Your code so far

var Car = function() {
  this.wheels = 4;
  this.engines = 1;
  this.seats = 5;
};

// Only change code below this line.

var myCar = function() {
  this.wheels = 4;
};

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36.

Link to the challenge:


#2

Hi JohnahEgorov,

This exercise asks you to give myCar a nickname property with a string value.

Remember you can call a function from the outside of the function.

Also if you take a look at the previous exercise “Construct JavaScript Objects with Functions”, as well as "Add New Properties to a JavaScript Object " https://www.freecodecamp.org/challenges/add-new-properties-to-a-javascript-object

These exercises will give you some clues as to how to solve it.

I hope this helps

Emma