JSFiddle - React, Tailwind, and code Playground
JavaScript
class Entity {
constructor (params) {
this.x = params.x
console.log(Object.getOwnPropertyDescriptor(this.constructor.prototype))
}
myProp () {
return 10
}
get computedProp () {
return this.myProp() + this.x
}
}
Entity.stuff = []
const myEntity = new Entity({ x: 15 })
console.log(Object.keys(myEntity))
console.log(myEntity.computedProp)