JSFiddle - React, Tailwind, and code Playground

JavaScript

class Polygon {
  constructor() {
    this.height = 11;
    this.width = 22;
  }
}

var Polygon2 = function(){
    this.height = 331;
    this.width = 44;
}

Polygon.Polygon2 = Polygon2;



var myObj = {};
myObj = Polygon;

myObj.Polygon2();
console.log(myObj.height)