Tell us what’s happening:
I understood fully how to add more properties and methods to an object and how we should set the constructor later, but I just wonder how we get arguments from the user into those new properties?
Your code so far
function Animal(name,legs){
this.name=name;
this.legs=legs;
}
//Animal.prototype ={
// constructor:Animal(name,legs,species),
//super(name,legs);
//this.species=species
//}
Animal.prototype ={
constructor:Animal,
species="birds"
}
const duck=new Animal("ducky",2);
console.log(duck.constructor);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
.
Link to the challenge:
I can’t include links yet but this is the lesson for more info
//https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/object-oriented-programming/change-the-prototype-to-a-new-object