Esercizio OO

by nickxbs

JavaScript

function Person(name){
    this.name = name;
}

Person.prototype.handshake = function(){
    console.log(this.name + " handshake");
}

function Worker(){
}

Worker.prototype = new Person();

var nicola = new Worker();

nicola.handshake();