Quiz
A short quiz to test your understanding of Inheritance in JavasScript.
We'll cover the following...
We'll cover the following...
Technical Quiz
1.
If we create 50 Animal object instances, how many definitions of method getName
and property name
will we have?
function Animal(name,age ) {
this.name = name
this.age = age
}
Animal.prototype.getName = function() {
return this.name
}
Animal.prototype.getAge = function() {
return this.age
}
A.
getName
: 1 , name
: 1
B.
getName
: 1, name
: 50
C.
getName
: 50, name
: 1
D.
getName
: 50, name
: 50
1 / 8