Is it possible to set this.variable
in then
? I know I can pass a regular variable, but can this be done with one set in the constructor as well?
class Test {
constructor() {
this.variable = false;
}
aFunction() {
someExternalThing(document.body, {
option: 1
}).then(function () {
this.variable = true;
});
}
}