JSFiddle - React, Tailwind, and code Playground

JavaScript

var Person = function(firstName, lastName)
{
  this.lastName = lastName;
  this.firstName = firstName;
  this.freeTime = "lots";
};

Object.defineProperties(Person.prototype, {
  sayHi: {
    value: function() {
      return "Hi my name is " + this.firstName;
    }
  },
  fullName: {
    get: function() {
      return this.firstName + " " + this.lastName;
    }
  }
});

var Employee = function(firstName, lastName, position) {
  this.firstName = firstName;
  this.lastName = lastName;
  this.position = position;
};

Employee.prototype = new Person;

var john= new Employee("John", "Doe", "Dev");
var jane = new Person("Jane", "Doe");

Employee.prototype.work = function() { document.write(this.fullName +" is doing some "+ this.position +" stuff<br/>"); };

john.work();
document.write(john.fullName+ " has " +john.freeTime+ " of free time.");