JSFiddle - React, Tailwind, and code Playground

by brigand

JavaScript

class Person {}

function Student() {
  // Call the parent constructor
  Person.call(this);
}

// inherit Person
Student.prototype = Object.create(Person.prototype);

// correct the constructor pointer because it points to Person
Student.prototype.constructor = Student;

new Student()