What am I missing here? Extend Constructors to Receive Arguments

Tell us what’s happening:

It looks like it’s okay but, it doesn’t work and passes the test why?

Your code so far


function Dog(name, color) {
this.name = "Albert";
this.color  = "blue";
this.numLegs = 4;
}
let terrier = new Dog("fluffy", "green" );

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36.

Challenge: Extend Constructors to Receive Arguments

Link to the challenge:

Hey there @KittyKora :wave:,

The challenge asked you to give it a name and color, you did it right, but the parameter would be useless because you didn’t set it up so it will change the name and color property of the class. So this.name and this.color won’t really change.

Hope this helps :slight_smile:

1 Like

Thank you :3 That helped and i was able to solve it

It should not be the string name but the name of the parameter.
By only calling the string it would’t change a thing

1 Like

Great job figuring it out… :clap:

1 Like