{"id":17005,"date":"2026-07-25T14:15:30","date_gmt":"2026-07-25T05:15:30","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=17005"},"modified":"2026-07-25T14:17:14","modified_gmt":"2026-07-25T05:17:14","slug":"typescript-%ec%95%bd%ed%95%9c-%ed%83%80%ec%9e%85-%ea%b0%90%ec%a7%80weak-type-detection-%ec%9d%bc%eb%b0%98%ec%a0%81%ec%9d%b8-%ed%83%80%ec%9e%85-%ed%98%b8%ed%99%98%ec%84%b1%ea%b5%ac%ec%a1%b0","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=17005","title":{"rendered":"TypeScript, \uc57d\ud55c \ud0c0\uc785 \uac10\uc9c0(Weak Type Detection) \/ \uc77c\ubc18\uc801\uc778 \ud0c0\uc785 \ud638\ud658\uc131(\uad6c\uc870\uc801 \ud0c0\uc774\ud551, structural typing) \uac80\uc0ac \/ \uc57d\ud55c \ud0c0\uc785 \uac10\uc9c0(Weak Type Detection)"},"content":{"rendered":"<p>\ub2e4\uc74c\uacfc \uac19\uc740 \ucf54\ub4dc\uac00 \uc788\ub2e4\uace0 \ud558\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\ninterface SquareConfig {\r\n  color?: string;\r\n  width?: number;\r\n}\r\n \r\nfunction createSquare(config: SquareConfig): { color: string; area: number } {\r\n  return {\r\n    color: config.color || \"red\",\r\n    area: config.width ? config.width * config.width : 20,\r\n  };\r\n}\r\n<\/pre>\n<p>\uc704\uc758 \ucf54\ub4dc\ub97c \uc0ac\uc6a9\ud558\ub294 \ub2e4\uc74c \ucf54\ub4dc\ub294 \uc5d0\ub7ec\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\nlet mySquare = createSquare({ colour: \"red\", width: 100 });\r\n<\/pre>\n<p>\uc778\uc815\ud560\ub9cc \ud569\ub2c8\ub2e4. <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">createSquare<\/code>\uc758 \uc778\uc790\ub294 <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">SquareConfig<\/code> \ud0c0\uc785\uc73c\ub85c, \uc774 \ud0c0\uc785\uc740 <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">color<\/code> \uc18d\uc131\uc744 \uac16\uace0 \uc788\uc9c0 <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">colour<\/code> \uc18d\uc131\uc774 \uc544\ub2c8\uae30 \ub54c\ubb38\uc785\ub2c8\ub2e4. \uc774\ub97c \uc57d\ud55c \ud0c0\uc785 \uac10\uc9c0(Weak Type Detection)\ub77c\uace0 \ud569\ub2c8\ub2e4. \uadf8\ub7f0\ub370 \ub2e4\uc74c \ucf54\ub4dc\ub294 &#8230;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\nlet squareOptions = { colour: \"red\", width: 100 };\r\nlet mySquare = createSquare(squareOptions);\r\n<\/pre>\n<p>\uc5d0\ub7ec\uac00 \uc544\ub2d9\ub2c8\ub2e4. \uc55e\uc11c \uc5d0\ub7ec\uac00 \uc788\ub358 \ucf54\ub4dc\ub294 <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">createSquare<\/code>\uc758 \uc778\uc790\uc5d0 \ubc14\ub85c \uac1d\uccb4 \ub9ac\ud130\ub110\ub97c \uc9c1\uc811 \uc804\ub2ec\ud558\uace0 \uc788\uc9c0\ub9cc \ub450\ubc88\uc9f8 \uc5d0\ub7ec\uac00 \uc5c6\ub294 \ucf54\ub4dc\uc5d0\uc11c\ub294 \uc77c\ub2e8 \uac1d\uccb4 \ub9ac\ud130\ub7f4\uc744 \uba3c\uc800 \ubcc0\uc218\uc5d0 \ud560\ub2f9\ud558\uace0 \uadf8 \ubcc0\uc218\ub97c \ud568\uc218\uc5d0 \uc804\ub2ec\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub807\uac8c \ud558\uba74 \ud568\uc218\uc758 \uc778\uc790 \ud0c0\uc785\uacfc \ubcc0\uc218 \uc0ac\uc774\uc758 \uad6c\uc870\ub97c \ube44\uad50\ud574\uc11c \uadf8 \uad6c\uc870\uc774 \ub9de\ub2e4\uba74 \ud1b5\uacfc, \uad6c\uc870\uac00 \ub9de\uc9c0 \uc54a\ub2e4\uba74 \uc5d0\ub7ec\ub85c \ucc98\ub9ac\ub429\ub2c8\ub2e4. <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">SquareConfig<\/code>\ub294 \ubaa8\ub4e0 \uc18d\uc131\uc5d0 \ub300\ud574 \uc635\uc154\ub110\uc774\ubbc0\ub85c \uad6c\uc870\uac00 \uc11c\ub85c \ud638\ud658\ub41c\ub2e4\uace0 \ud310\ub2e8\ub418\uc5b4 \uc5d0\ub7ec\ub85c \ucc98\ub9ac\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. \uc774\ub97c \uc77c\ubc18\uc801\uc778 \ud0c0\uc785 \ud638\ud658\uc131(\uad6c\uc870\uc801 \ud0c0\uc774\ud551, structural typing) \uac80\uc0ac\ub77c\uace0 \ud569\ub2c8\ub2e4. \uadf8\ub7f0\ub370 \ub2e4\uc74c \ucf54\ub4dc\ub294 \uc5d0\ub7ec\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\nlet squareOptions = { colour: \"red\" };\r\nlet mySquare = createSquare(squareOptions);\r\n<\/pre>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">SquareConfig<\/code>\ub294 \ubaa8\ub4e0 \uc18d\uc131\uc5d0 \ub300\ud574 \uc635\uc154\ub110\uc774\ubbc0\ub85c \ubb38\uc81c\uac00 \uc5c6\uc5b4\uc57c \ud569\ub2c8\ub2e4. \ud558\uc9c0\ub9cc <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">SquareConfig<\/code> \ud0c0\uc785\uc740 \ub9e4\uc6b0 \ud2b9\uc218\ud55c \uacbd\uc6b0\ub85c \ucc98\ub9ac\ub429\ub2c8\ub2e4. <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">SquareConfig<\/code>\ub294 \ubaa8\ub4e0 \uc18d\uc131\uc774 \uc635\uc154\ub110\uc785\ub2c8\ub2e4. \uc774\ucc98\ub7fc \ubaa8\ub4e0 \uc18d\uc131\uc774 \uc635\uc154\ub110\uc77c \uacbd\uc6b0\uc5d0\ub294 \ubc18\ub4dc\uc2dc \uc18d\uc131 \uc911 \ud558\ub098\ub77c\ub3c4 \uac19\uc740 \uc18d\uc131\uc774 \uc874\uc7ac\ud574\uc57c \ud569\ub2c8\ub2e4. \uc774\ub7f0 \uac80\uc0ac\ub97c \uc57d\ud55c \ud0c0\uc785 \uac10\uc9c0(Weak Type Detection)\ub77c\uace0 \ud569\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ub2e4\uc74c\uacfc \uac19\uc740 \ucf54\ub4dc\uac00 \uc788\ub2e4\uace0 \ud558\uaca0\uc2b5\ub2c8\ub2e4. interface SquareConfig { color?: string; width?: number; } function createSquare(config: SquareConfig): { color: string; area: number } { return { color: config.color || &#8220;red&#8221;, area: config.width ? config.width * config.width : 20, }; } \uc704\uc758 \ucf54\ub4dc\ub97c \uc0ac\uc6a9\ud558\ub294 \ub2e4\uc74c \ucf54\ub4dc\ub294 \uc5d0\ub7ec\uc785\ub2c8\ub2e4. let mySquare = createSquare({ colour: &#8220;red&#8221;, width: 100 }); \uc778\uc815\ud560\ub9cc &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=17005\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;TypeScript, \uc57d\ud55c \ud0c0\uc785 \uac10\uc9c0(Weak Type Detection) \/ \uc77c\ubc18\uc801\uc778 \ud0c0\uc785 \ud638\ud658\uc131(\uad6c\uc870\uc801 \ud0c0\uc774\ud551, structural typing) \uac80\uc0ac \/ \uc57d\ud55c \ud0c0\uc785 \uac10\uc9c0(Weak Type Detection)&#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-17005","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\/17005","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=17005"}],"version-history":[{"count":3,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/17005\/revisions"}],"predecessor-version":[{"id":17008,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/17005\/revisions\/17008"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17005"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}