Back to Type Challenges

README.Ko

questions/01097-medium-isunion/README.ko.md

latest2.2 KB
Original Source
<!--info-header-start--><h1>IsUnion </h1><blockquote><p>by null <a href="https://github.com/bencor" target="_blank">@bencor</a></p></blockquote><p><a href="https://tsch.js.org/1097/play/ko" target="_blank"></a> &nbsp;&nbsp;&nbsp;<a href="./README.md" target="_blank"></a> </p><!--info-header-end-->

T를 입력으로 받고, TUnion 유형으로 확인되는지 여부를 반환하는 IsUnion을 구현하세요

예시:

ts
type case1 = IsUnion<string> // false
type case2 = IsUnion<string | number> // true
type case3 = IsUnion<[string | number]> // false
<!--info-footer-start-->

<a href="../../README.ko.md" target="_blank"></a> <a href="https://tsch.js.org/1097/answer/ko" target="_blank"></a> <a href="https://tsch.js.org/1097/solutions" target="_blank"></a> <hr><h3>관련된 문제들</h3><a href="https://github.com/type-challenges/type-challenges/blob/main/questions/01042-medium-isnever/README.ko.md" target="_blank"></a> <a href="https://github.com/type-challenges/type-challenges/blob/main/questions/00223-hard-isany/README.md" target="_blank"></a> <a href="https://github.com/type-challenges/type-challenges/blob/main/questions/04484-medium-istuple/README.md" target="_blank"></a> <!--info-footer-end-->