I have a constructor Monkey()
:
function Monkey(name, age) {
this.name = name;
this.age = age;
}
I want to make another constructor named Human()
with an extra property cars
which will store number of cars the person has along with all the property that Monkey
has (like name
and age
)
I don't want to repeat all the Monkey
stuff in the new Human
stuff. Is is possible to clone the Monkey
and extend a property with prototype?