When working with JSDoc, achieving the equivalent of Typescript's computed property names can be a challenge. In Typescript, you'd simply define it like this:
class Test {
[key: string]: whatever
}
This syntax allows you to access these computed property names easily:
class Test {
getProp(key) {
return this[key]
}
}
However, in JSDoc, you might encounter errors such as
Element implicitly has an 'any' type because type 'Test' has no index signature.
. Has anyone found a solution for this issue?