Answers for "typescript type of return function"

1

get function return type typescript

type return_type = ReturnType<() => string>; // string
// or
function hello_world(): string {
  return "hello world";
}
type return_type = ReturnType<typeof hello_world>; // string
Posted by: Guest on October-11-2020

Code answers related to "typescript type of return function"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language