I am facing an issue with referencing the this
object in a function called problem
:
const c = {
f() {
console.log("hi");
},
problem: ko.pureComputed(() => {
return this.f();
}),
};
[ts] The containing arrow function captures the global value of 'this' which implicitly has type 'any'.
If I use c
instead of this
:
const c = {
f() {
console.log("hi");
},
problem: ko.pureComputed(() => {
return c.f();
}),
};
[ts] 'c' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
Seeking assistance and explanation. Thank you!