Object Oriented Programming - Extend Constructors to Receive Arguments

Tell us what’s happening:
Describe your issue in detail here.

I have the numLegs to 4
but it still saying that I have to set numLegs a value of 4

Your code so far

function Dog (name, color, numLegs) {
  this.name = name;
  this.color = color;
  this.numLegs = numLegs;
}

const terrier = new Dog("Mag", "black", 4)
console.log(terrier)

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36

Challenge: Object Oriented Programming - Extend Constructors to Receive Arguments

Link to the challenge:

You are not passing because you din’t follow the directions.

The directions say : " Pass it two strings as arguments for the name and color properties."

But you have three strings.

Also, the directions say " set it up to take the parameters name and color , and have the property numLegs fixed at 4."

But you created 3 parameters and numLegs is not fixed at 4."

Once you fix those things, then it will pass

1 Like