JSFiddle - React, Tailwind, and code Playground

by Vlad Rasenko

JavaScript

const JSLicense = function (parent) {
  const license = function (name) {
		return new JSLicense(name || license)
  }
  debugger
	if (typeof parent === 'function') {
		license.__proto__.__proto__ = parent.prototype
	}
  return license
}

const l1 = new JSLicense('1')
const l2 = new l1
const l3 = new l2
const l4 = new l3

console.log(Object.getPrototypeOf(l1) === Object.getPrototypeOf(Function), Object.getPrototypeOf(l1.prototype) === Object.getPrototypeOf(Function.prototype))
console.log(l2 instanceof l1, l3 instanceof l2, l3 instanceof l1, l4 instanceof l1)