Get Return Type 中級 #infer #built-in

by Anthony Fu @antfu

挑戦する    English 简体中文 한국어 Português (BR)

組み込みの型ユーティリティ`ReturnType`を使用せず、`T`の戻り値の型を取得する型を実装します。 例えば ```ts const fn = (v: boolean) => { if (v) return 1 else return 2 } type a = MyReturnType // should be "1 | 2" ```
戻る 解答を共有 解答を確認