JSFiddle - React, Tailwind, and code Playground
by nickxbs
JavaScript
function Person(name){
this.name = name;
}
Person.prototype.handshake = function(){
console.log(this.name + " handshake");
}
function Worker(name){
Person.call(this,name);
}
Worker.prototype = new Person();
var sandro = new Worker("Sandro");
sandro.handshake();