let message;
class Test {
//message = "Hi";
constructor() {
someFunction.load(model, async function() {
message = "Hello world 2"
})
this.msg = message
}
}
const random = new Test();
console.log(random.msg) //undefined
The variable's value is obtained from inside the someFunction, and placing this.msg = message statement outside the constructor does not work either. I need to access the message property after its value is declared inside the someFunction and I dont seem to be able to find any resources.
Kindly help.