JSFiddle - React, Tailwind, and code Playground
by msfrisbie
JavaScript
class Foo {
constructor() {
this.bar = 'baz';
}
}
Object.defineProperty(Foo, 'qux', {
get: () => { return this.bar; }
})
let f = new Foo
console.log(f.qux)
by msfrisbie
class Foo {
constructor() {
this.bar = 'baz';
}
}
Object.defineProperty(Foo, 'qux', {
get: () => { return this.bar; }
})
let f = new Foo
console.log(f.qux)