JSFiddle - React, Tailwind, and code Playground
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();