{"id":16956,"date":"2026-07-21T09:28:17","date_gmt":"2026-07-21T00:28:17","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=16956"},"modified":"2026-07-21T09:31:56","modified_gmt":"2026-07-21T00:31:56","slug":"%ec%98%a4%eb%b2%84%eb%a1%9c%eb%93%9c-%ec%8b%9c%ea%b7%b8%eb%8b%88%ec%b3%90-vs-%ec%a1%b0%ea%b1%b4%eb%b6%80-%ed%83%80%ec%9e%85","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=16956","title":{"rendered":"TypeScript, \uc624\ubc84\ub85c\ub4dc \uc2dc\uadf8\ub2c8\uccd0 vs \uc870\uac74\ubd80 \ud0c0\uc785"},"content":{"rendered":"<p>\ub2e4\uc74c\uacfc \uac19\uc740 \ud0c0\uc785\uc774 \uc788\ub2e4\uace0 \ud560\ub54c &#8230;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\ninterface IdLabel {\r\n  id: number;\r\n}\r\n\r\ninterface NameLabel {\r\n  name: string;\r\n}\r\n<\/pre>\n<p>\uc22b\uc790\ud615 id \uc778\uc790\ub098 \ubb38\uc790\uc5f4 name \uc778\uc790\uc911 \uc5b4\ub5a4 \uc778\uc790\ub97c \ubc1b\ub290\ub0d0\uc5d0 \ub530\ub77c \uad6c\ud604\uc774 \ub2ec\ub77c\uc9c0\ub294 \ud568\uc218\ub97c \uc815\uc758\ud558\uae30 \uc704\ud574 \uc624\ubc84\ub85c\ub4dc \uc2dc\uadf8\ub2c8\uccd0 \ubc29\uc2dd\uc73c\ub85c \ub2e4\uc74c\ucc98\ub7fc \ud568\uc218\ub97c \uc815\uc758\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\nfunction createLabel(id: number): IdLabel;\r\nfunction createLabel(name: string): NameLabel;\r\nfunction createLabel(nameOrId: string | number): IdLabel | NameLabel;\r\nfunction createLabel(nameOrId: string | number): IdLabel | NameLabel {\r\n  throw \"unimplemented\";\r\n}\r\n<\/pre>\n<p>\ucf54\ub4dc\uac00 \uc911\ubcf5\uc801\uc774\uace0 \uc7a5\ud669\ud569\ub2c8\ub2e4. \uc774\ub97c \uc870\uac74\ubd80 \ud0c0\uc785 \ubc29\uc2dd\uc73c\ub85c \uc644\uc804\ud788 \ub3d9\uc77c\ud558\uac8c \uc791\ub3d9\ud558\ub294 \ud568\uc218\ub97c \uc815\uc758\ud558\uba74 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\ntype NameOrId&lt;T extends number | string> = T extends number\r\n  ? IdLabel\r\n  : NameLabel;\r\n\r\nfunction createLabel2&lt;T extends number | string>(idOrName: T): NameOrId&lt;T> {\r\n  throw \"unimplemented\";\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\ub2e4\uc74c\uacfc \uac19\uc740 \ud0c0\uc785\uc774 \uc788\ub2e4\uace0 \ud560\ub54c &#8230; interface IdLabel { id: number; } interface NameLabel { name: string; } \uc22b\uc790\ud615 id \uc778\uc790\ub098 \ubb38\uc790\uc5f4 name \uc778\uc790\uc911 \uc5b4\ub5a4 \uc778\uc790\ub97c \ubc1b\ub290\ub0d0\uc5d0 \ub530\ub77c \uad6c\ud604\uc774 \ub2ec\ub77c\uc9c0\ub294 \ud568\uc218\ub97c \uc815\uc758\ud558\uae30 \uc704\ud574 \uc624\ubc84\ub85c\ub4dc \uc2dc\uadf8\ub2c8\uccd0 \ubc29\uc2dd\uc73c\ub85c \ub2e4\uc74c\ucc98\ub7fc \ud568\uc218\ub97c \uc815\uc758\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. function createLabel(id: number): IdLabel; function createLabel(name: string): NameLabel; function createLabel(nameOrId: string | number): IdLabel &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=16956\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;TypeScript, \uc624\ubc84\ub85c\ub4dc \uc2dc\uadf8\ub2c8\uccd0 vs \uc870\uac74\ubd80 \ud0c0\uc785&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[157],"tags":[],"class_list":["post-16956","post","type-post","status-publish","format-standard","hentry","category-typescript"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/16956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16956"}],"version-history":[{"count":6,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/16956\/revisions"}],"predecessor-version":[{"id":16960,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/16956\/revisions\/16960"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16956"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}