class Hey { constructor (something) { this.is = something } get something () {return this.is} set something (clever) {this.is = clever} regular (method) {return this.is + method} static something () {return 'amazing'} }
var hey = new Hey('nasty')
console.log(hey.something)
// nasty
hey.something = 'really'
// really
console.log(hey.regular('method'))
// reallymethod
console.log(Hey.something())
// amazing
var Hey = (something) => { var self = { something, regular: (method) => self.something + method } return self } Hey.something = () => 'amazing'
By Simeon Velichkov