questions/00268-easy-if/README.zh-CN.md
实现一个 IF 类型,它接收一个条件类型 C ,一个判断为真时的返回类型 T ,以及一个判断为假时的返回类型 F。 C 只能是 true 或者 false, T 和 F 可以是任意类型。
例如:
type A = If<true, 'a', 'b'> // expected to be 'a'
type B = If<false, 'a', 'b'> // expected to be 'b'
<a href="../../README.zh-CN.md" target="_blank"></a> <a href="https://tsch.js.org/268/answer/zh-CN" target="_blank"></a> <a href="https://tsch.js.org/268/solutions" target="_blank"></a> <!--info-footer-end-->