I have encountered with something like this:
class Example {
// ...
async #privateMethod() {
return true
}
static staticMethod() {
try {
// can't access #privateMethod
this.#privateMethod()
} catch (error) {
console.log('error', error);
}
}
}
I want to call a private method within the static method, but I can’t access the private method for some reason. What am I doing wrong, please?