//Define a functional object to hold persons in javascript
var Person = function (name) {
this.name = name;
};
//Add dynamically to the already defined object a new getter
Person.prototype.getName = function () {
return this.name;
};
//Create a new object of type Person
var john = new Person("John");
john.getName( // hint here shows ?
//Define a functional object to hold persons in javascript
var Person = function (name) {
this.name = name;
};
//Add dynamically to the already defined object a new getter
Person.prototype.getName = function () {
return this.name;
};
//Create a new object of type Person
var john = new Person("John");
john.getName( // hint here shows ?