Typescript function parameter into returnType
Here's my function:
It returns as below
I want to use the function in the below syntax:
and not
🤨 How can I create the type
Name
- from the value of the parameter name
- and use it in the returnType
thing so I avoid typing 'test'
twice in the call?1 Reply
ReturnType takes only 1 argument you cant add 2 types there so
just your own new type that you want to satisfy