{"id":17049,"date":"2026-07-30T06:17:11","date_gmt":"2026-07-29T21:17:11","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=17049"},"modified":"2026-07-30T06:27:07","modified_gmt":"2026-07-29T21:27:07","slug":"typescript","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=17049","title":{"rendered":"TypeScript, <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">{}<\/code>"},"content":{"rendered":"<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">{}<\/code>\ub294 \ube48 \uac1d\uccb4\uc785\ub2c8\ub2e4. \ud558\uc9c0\ub9cc TypeScript\uc5d0\uc11c\ub294 <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">null<\/code>\uacfc <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">undefined<\/code>\ub97c \uc81c\uc678\ud55c \ubaa8\ub4e0 \uac12\uc744 \uc758\ubbf8\ud558\ub294 \ud2b9\uc218\ud55c \ud0c0\uc785\uc774\uae30\ub3c4 \ud569\ub2c8\ub2e4.<\/p>\n<p>\uadf8\ub798\uc11c \ub2e4\uc74c \ucf54\ub4dc\uac00 \uc788\ub2e4\uace0 \ud55c\ub2e4\uba74 &#8230;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\ntype A = {}\r\nlet a: A;\r\n<\/pre>\n<p>\ub2e4\uc74c \ucf54\ub4dc\ub294 \ubaa8\ub450 \ubb38\uc81c\uac00 \uc5c6\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\na = \"hello\";\r\na = 123;\r\na = true;\r\na = [];\r\na = {};\r\na = () => {};\r\n<\/pre>\n<p>\uadf8\ub7ec\ub098 \ub2e4\uc74c \ucf54\ub4dc\ub294 \uc5d0\ub7ec\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\na = null;\r\na = undefined;\r\n<\/pre>\n<p>\uadf8\ub7fc <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">{}<\/code> \ud0c0\uc785\uc740 \uc5b4\ub514\uc5d0 \uc4f0\ub294 \ubb3c\uac74\uc77c\uae4c\uc694? \ubc14\ub85c <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">NonNullable<\/code> \uc785\ub2c8\ub2e4. <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">NonNullable<\/code>\uc740 \ub2e4\uc74c\ucc98\ub7fc \uc791\uc131\ub418\uc5b4\uc838 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\ntype NonNullable&lt;T> = T & {}\r\n<\/pre>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">NonNullable<\/code>\uc740 \ud0c0\uc785\uc5d0\uc11c <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">null<\/code>\uacfc <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">undefined<\/code>\ub97c \uc81c\uc678\uc2dc\ud0a8 \ud0c0\uc785\uc744 \ub9cc\ub4e4\uc5b4\uc90d\ub2c8\ub2e4. \uc544\ub798\ucf54\ub4dc\ucc98\ub7fc\uc694.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\ntype T0 = NonNullable&lt;string | number | undefined>;\r\n\/\/ type T0 = string | number\r\n\r\ntype T1 = NonNullable&lt;string[] | null | undefined>;\r\n\/\/ type T1 = string[]\r\n<\/pre>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">NonNullable<\/code>\uc758 \uad6c\ud604\uc740 TypeScript\uc758 \ubc84\uc804\uc5d0 \ub530\ub77c \ub2e4\ub978\ub370\uc694. \uc880\ub354 \uc624\ub798\ub41c 4.8\uc5d0\uc11c\ub294 \ub2e4\uc74c\ucc98\ub7fc \uad6c\ud604\ub418\uc5b4 \uc788\ub2e4\ub294 \uc810\ub3c4 \uc54c\uc544\ub450\uc2dc\uba74 \uc88b\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\ntype NonNullable&lt;T> =\r\n    T extends null | undefined\r\n        ? never\r\n        : T;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>{}\ub294 \ube48 \uac1d\uccb4\uc785\ub2c8\ub2e4. \ud558\uc9c0\ub9cc TypeScript\uc5d0\uc11c\ub294 null\uacfc undefined\ub97c \uc81c\uc678\ud55c \ubaa8\ub4e0 \uac12\uc744 \uc758\ubbf8\ud558\ub294 \ud2b9\uc218\ud55c \ud0c0\uc785\uc774\uae30\ub3c4 \ud569\ub2c8\ub2e4. \uadf8\ub798\uc11c \ub2e4\uc74c \ucf54\ub4dc\uac00 \uc788\ub2e4\uace0 \ud55c\ub2e4\uba74 &#8230; type A = {} let a: A; \ub2e4\uc74c \ucf54\ub4dc\ub294 \ubaa8\ub450 \ubb38\uc81c\uac00 \uc5c6\uc2b5\ub2c8\ub2e4. a = &#8220;hello&#8221;; a = 123; a = true; a = []; a = {}; a = () => {}; \uadf8\ub7ec\ub098 \ub2e4\uc74c \ucf54\ub4dc\ub294 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=17049\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;TypeScript, <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">{}<\/code>&#8220;<\/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-17049","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\/17049","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=17049"}],"version-history":[{"count":4,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/17049\/revisions"}],"predecessor-version":[{"id":17051,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/17049\/revisions\/17051"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17049"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}