Answers for "typescript return type of 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 return type of function."

Code answers related to "TypeScript"

Browse Popular Code Answers by Language