Answers for "get function return type typescript"

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 "get function return type typescript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language