class A {
constructor() {
this.a = ""
}
run() {
b.on("event", function(data) {
// how to access variable a here?
})
}
}
how to access a class variable inside a closure?
class A {
constructor() {
this.a = ""
}
run() {
b.on("event", function(data) {
// how to access variable a here?
})
}
}
how to access a class variable inside a closure?