Extend Constructors to Receive Arguments, numlegs = 4

Tell us what’s happening:

Your code so far


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

let terrier = new Dog("Bruce", "red");

I thought numlegs was inherited from Dog & i don’t see a way to add it to the new dog, terrier, since it is hard coded as an interger in the constructor. Please explain & where can I find more information about this as I have spent several hours looking for it to no avail.
Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/object-oriented-programming/extend-constructors-to-receive-arguments

you actually don’t need to add numLegs again. It is already there in Dog’s constructor.

So if you want to see what it is equal to, just write terrier.numLegs to the console and you should get 4

oh I see the problem you are having.

You mispelled numLegs. Capitalize the l to L

ThankYou hbar1st! That’s like forgetting a ;, but worse.

1 Like

finally found the answer man that was annoying. so basically terrier.name -> name parameter then it refers to the parameter value “red”. Man this that bullsh*t!