So I have this problem:
class ClassName {
constructor(value) {
this.value = value;
}
someObject = {
someFunction() {
console.log(this.value);
}
}
}
The this.value
of someFunction()
doesnt reference the value defined within the constructor, it is because someFunction()
is part of the someObject
Object and this
references the Object.
So how can I reference the top/root of the Class within Objects/Properties of it to access values and properties there? I can also work with each Function being at the top level, but grouping them is way clearer.