javal.ge

TypeScript `infer`

type ReturnType<T> = T extends (...args: any[]) => infer R ? R : any;
Use the `infer` keyword within conditional types to extract specific types from complex structures, such as the return type of a function.
Back to Tips

🍪 Cookie Consent

We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By clicking "Accept", you consent to our use of cookies.