Pass a Class
function callMethods(evt) {
const e = new evt
e.one()
e.two()
}
callMethods(class {
one() {
console.log('one')
}
two() {
console.log('two')
}
})
This is so tempting for something I want to do… but too strange to use probably… maybe…
function callMethods(evt) {
const e = new evt
e.one()
e.two()
}
callMethods(class {
one() {
console.log('one')
}
two() {
console.log('two')
}
})
This is so tempting for something I want to do… but too strange to use probably… maybe…