{"id":1815,"date":"2013-03-13T08:10:29","date_gmt":"2013-03-13T08:10:29","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=1815"},"modified":"2017-01-27T14:42:32","modified_gmt":"2017-01-27T05:42:32","slug":"javascript-%ec%a3%bc%ec%9d%98%ed%95%b4%ec%95%bc%ed%95%a0-%eb%b3%80%ec%88%98%ec%97%90-%eb%8c%80%ed%95%9c-%ed%98%b8%ec%9d%b4%ec%8a%a4%ed%8c%85hoisting","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=1815","title":{"rendered":"[JavaScript] \uc8fc\uc758\ud574\uc57c \ud560 &#8216;\ubcc0\uc218\uc5d0 \ub300\ud55c \ud638\uc774\uc2a4\ud305(hoisting)&#8217;"},"content":{"rendered":"<p>\uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\uc5d0\uc11c \ubcc0\uc218\uc5d0 \ub300\ud55c \ud638\uc774\uc2a4\ud305\uc774\ub77c\ub294 \uac1c\ub150\uc774 \uc788\uc2b5\ub2c8\ub2e4. \ud568\uc218 \uc548\uc5d0 \uc815\uc758\ub41c \ubaa8\ub4e0 \ubcc0\uc218\ub294 \uc120\uc5b8\ub41c \uadf8 \uc704\uce58\uc5d0 \uc0c1\uad00\uc5c6\uc774 \ud568\uc218\uc758 \uc717\ubd80\ubd84\uc73c\ub85c \ub04c\uc5b4\uc62c\ub824(hoist)\ub41c\ub2e4\ub77c\ub294 \uac1c\ub150\uc785\ub2c8\ub2e4. \uc5ec\uae30\uc11c \uc8fc\uc758\ud560 \uc810\uc740 \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\uc5d0\uc11c \ud568\uc218\ub3c4 \uac1d\uccb4 \ubcc0\uc218\uc774\uba70 \uc774 \ud568\uc218\uac00 \ud638\uc774\uc2a4\ud305\ub420\ub54c\uc785\ub2c8\ub2e4.. \ud568\uc218\ub97c \uc815\uc758\ud558\uace0 \uc120\uc5b8\ud558\ub294 \ubc29\ubc95\uc744 \ud06c\uac8c 2\uac00\uc9c0\ub85c \uad6c\ubd84\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p><UL><LI>\ud45c\ud604\uc2dd\uc5d0 \uc758\ud55c \uc815\uc758<LI>\uc120\uc5b8\ubb38\uc5d0 \uc758\ud55c \uc815\uc758<\/LI><\/UL><\/p>\n<p>\uba3c\uc800 \ud45c\ud604\uc2dd\uc5d0 \uc758\ud55c \uc815\uc758\uc758 \uc608\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre>var bar = function() {\r\n     \/\/ \ud45c\ud604\uc2dd\uc5d0 \uc758\ud55c \ud568\uc218 \uc815\uc758 \r\n}; <\/pre>\n<p> \ub2e4\uc74c\uc740 \uc120\uc5b8\ubb38\uc5d0 \uc758\ud55c \uc815\uc758\uc758 \uc608\uc785\ub2c8\ub2e4. <BR><\/p>\n<pre>function foo() { \r\n    \/\/ \uc120\uc5b8\ubb38\uc5d0 \uc758\ud55c \ud568\uc218 \uc815\uc758\r\n} <\/pre>\n<p>\uc774\ub7ec\ud55c \ud568\uc218 \uc815\uc758\uac00 \ud568\uc218 \uc548\uc5d0\uc11c \uc774\ub8e8\uc5b4\uc9c8\ub54c \ud638\uc774\uc2a4\ud305\uc5d0 \ucc28\uc774\uac00 \ubc1c\uc0dd\ud558\uac8c \ub429\ub2c8\ub2e4. <\/p>\n<pre>function test() { \r\n    alert(typeof foo); \r\n    alert(typeof bar); \r\n\r\n    function foo() { \r\n        \/\/ \uc120\uc5b8\ubb38\uc5d0 \uc758\ud55c \ud568\uc218 \uc815\uc758 \r\n    } \r\n    \r\n    var bar = function() {\r\n         \/\/ \ud45c\ud604\uc2dd\uc5d0 \uc758\ud55c \ud568\uc218 \uc815\uc758 \r\n    }; \r\n} \r\n\r\ntest();<\/pre>\n<p>\uc704\uc758 \ucf54\ub4dc\ub97c \uc2e4\ud589\ud574 \ubcf4\uba74 \ucc98\uc74c\uc5d0\ub294 &#8220;function&#8221;\uc774\ub77c\ub294 \uba54\uc138\uc9c0\uac00 \ud45c\uc2dc\ub418\uace0 \ub2e4\uc74c\uc5d0\ub294 &#8220;undefined&#8221;\ub77c\ub294 \uba54\uc138\uc9c0\uac00 \ud45c\uc2dc\ub429\ub2c8\ub2e4. \uc774\ub294 \ud45c\ud604\uc2dd\uc5d0 \ub300\ud55c \ud568\uc218 \uc815\uc758\uc2dc\uc5d0 \ud568\uc218 \uac1d\uccb4\uac00 \ud638\uc774\uc2a4\ud305\ub420\ub54c \ud568\uc218\uc758 \ucf54\ub4dc\ubd80\ubd84\uc740 \ud638\uc774\uc2a4\ud305\ub418\uc9c0 \uc54a\uc9c0\ub9cc \uc120\uc5b8\ubb38\uc73c\ub85c \ud568\uc218\uac00 \uc815\uc758\ub420 \uacbd\uc6b0\uc5d0\ub294 \ud568\uc218\uc758 \ucf54\ub4dc\ubd80\ubd84\uae4c\uc9c0\ub3c4 \ud638\uc774\uc2a4\ud305\ub41c\ub2e4\ub294 \uac83\uc744 \uc54c \uc218 \uc788\uc2b5\ub2c8\ub2e4.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\uc5d0\uc11c \ubcc0\uc218\uc5d0 \ub300\ud55c \ud638\uc774\uc2a4\ud305\uc774\ub77c\ub294 \uac1c\ub150\uc774 \uc788\uc2b5\ub2c8\ub2e4. \ud568\uc218 \uc548\uc5d0 \uc815\uc758\ub41c \ubaa8\ub4e0 \ubcc0\uc218\ub294 \uc120\uc5b8\ub41c \uadf8 \uc704\uce58\uc5d0 \uc0c1\uad00\uc5c6\uc774 \ud568\uc218\uc758 \uc717\ubd80\ubd84\uc73c\ub85c \ub04c\uc5b4\uc62c\ub824(hoist)\ub41c\ub2e4\ub77c\ub294 \uac1c\ub150\uc785\ub2c8\ub2e4. \uc5ec\uae30\uc11c \uc8fc\uc758\ud560 \uc810\uc740 \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8\uc5d0\uc11c \ud568\uc218\ub3c4 \uac1d\uccb4 \ubcc0\uc218\uc774\uba70 \uc774 \ud568\uc218\uac00 \ud638\uc774\uc2a4\ud305\ub420\ub54c\uc785\ub2c8\ub2e4.. \ud568\uc218\ub97c \uc815\uc758\ud558\uace0 \uc120\uc5b8\ud558\ub294 \ubc29\ubc95\uc744 \ud06c\uac8c 2\uac00\uc9c0\ub85c \uad6c\ubd84\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud45c\ud604\uc2dd\uc5d0 \uc758\ud55c \uc815\uc758\uc120\uc5b8\ubb38\uc5d0 \uc758\ud55c \uc815\uc758 \uba3c\uc800 \ud45c\ud604\uc2dd\uc5d0 \uc758\ud55c \uc815\uc758\uc758 \uc608\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4. var bar = function() { &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=1815\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;[JavaScript] \uc8fc\uc758\ud574\uc57c \ud560 &#8216;\ubcc0\uc218\uc5d0 \ub300\ud55c \ud638\uc774\uc2a4\ud305(hoisting)&#8217;&#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":[88],"tags":[87],"class_list":["post-1815","post","type-post","status-publish","format-standard","hentry","category-javascript","tag-javascript"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1815","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=1815"}],"version-history":[{"count":4,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1815\/revisions"}],"predecessor-version":[{"id":3002,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1815\/revisions\/3002"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1815"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1815"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}