Slide 15
Slide 15 text
OOP - Prototype
function Person(first, last) {
this.firstName = first;
this.lastName = last;
}
var glauber = new Person('Glauber', 'Ramos');
Person.prototype.fullName = function() {
return this.firstName + ' ' + this.lastName;
};
var joao = new Person('João', 'Bohrer');
console.log(glauber.fullName());
console.log(joao.fullName());