'show Definition or Type definition for built in js methods with ts
I don't know if I had this issue with my other projects I am using Typescript and react from CRA for an electron application. It doesn't cause me any issues. But I would love to get a definition on methods like .splice() or .toLowerCase() when I hover over them so I don't have to take a quick look on w3 or mdn for what parameters to pass. I don't have a problem getting the definition or type definition of functions I have written. Or from Packages I use. I have intellisense and js and ts language support extensions installed.
After looking into it further This problem for me has to do with Typescript seeing a value or prop as any. so the method any.splice() has no definition while [].splice() does.
I have types declared for this object called data and one of its props is email_addresses which has a type for it. but ts assumes it is any? -- it is and object in an object
type ConfigPageType = {
email_addresses: EmailAddressesType[]
}
why is it any? I get data from an axios response and it properly says data is ConfigPageType but email_addresses is any? Please answer why email_addresses is any And if there is a way to get the definition of val.splice() or val.toLowerCase() when val is any?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
