{"id":130,"date":"2015-08-09T16:52:00","date_gmt":"2015-08-09T07:52:00","guid":{"rendered":"https:\/\/trret.com\/?p=130"},"modified":"2021-03-19T23:47:20","modified_gmt":"2021-03-19T14:47:20","slug":"130","status":"publish","type":"post","link":"https:\/\/trret.com\/?p=130","title":{"rendered":"JavaScript \uae30\ubcf8 \ubb38\ubc95"},"content":{"rendered":"\n<p>\u2605 \uc2dd\ubcc4\uc790<\/p>\n\n\n\n1. \ud0a4\uc6cc\ub4dc(return), \uc22b\uc790\ub85c \uc2dc\uc791\ub418\uac70\ub098(3content), \ube48\uce78\uc774 \uc788\uac70\ub098(no value)\ub294 \uc2dd\ubcc4\uc790\ub85c \uc4f8 \uc218 \uc5c6\ub2e4.<br>\n2. \uc0dd\uc131\uc790 \ud568\uc218\uc758 \uc774\ub984\uc740 \ud56d\uc0c1 \ub300\ubb38\uc790\ub85c \uc2dc\uc791\ud55c\ub2e4.<br>\n3. \ubcc0\uc218\uc640 \uc778\uc2a4\ud134\uc2a4, \ud568\uc218, \uba54\uc11c\ub4dc\uc758 \uc774\ub984\uc740 \ud56d\uc0c1 \uc18c\ubb38\uc790\ub85c \uc2dc\uc791\ud55c\ub2e4.<br>\n4. \uc5ec\ub7ec \ub2e8\uc5b4\ub85c \uc774\ub8e8\uc5b4\uc9c4 \uc2dd\ubcc4\uc790\ub294 \uac01 \ub2e8\uc5b4\uc758 \uccab \uae00\uc790\ub97c \ub300\ubb38\uc790\ub85c \ud55c\ub2e4.\n\n\n\n<p>\u2605 \uc2dd\ubcc4\uc790\uc758 \uc885\ub958<br>\uba54\uc11c\ub4dc : \uc2dd\ubcc4\uc790 \ub4a4\uc5d0 \uad04\ud638\uc788\uc74c | \uc5b4\ub5a4 \ub300\uc0c1\uc774 \uac00\uc9c4 \ud568\uc218<br>\uc18d\uc131 : \uc2dd\ubcc4\uc790 \ub4a4\uc5d0 \uad04\ud638\uc5c6\uc74c | \uc5b4\ub5a4 \ub300\uc0c1\uc774 \uac00\uc9c4 \ubcc0\uc218<br>alert(&#8216;hello&#8217;) =&gt; \ud568\uc218<br>Array.length =&gt; \uc18d\uc131<br>Math.abs(-273) =&gt; \uba54\uc11c\ub4dc<\/p>\n\n\n\n<p>\u2605 \ubb38\uc790\uc5f4\uc548\uc5d0 \ub530\uc634\ud45c\ub97c \ub123\uae30<br>\ub0b4\ubd80\uc5d0 \uc791\uc740\ub530\uc634\ud45c\ub97c \uc0ac\uc6a9\ud558\uace0 \uc2f6\ub2e4\uba74 \uc678\ubd80\uc5d0 \ud070\ub530\uc634\ud45c\ub97c \uc0ac\uc6a9\ud55c\ub2e4.<br>\uad73\uc774 \uac19\uc740 \uac83\uc744 \uc4f0\uace0 \uc2f6\ub2e4\uba74 \ub530\uc634\ud45c \uc55e\uc5d0 \uc774\uc2a4\ucf00\uc774\ud504\ubb38\uc790\ub97c \uc0ac\uc6a9\ud55c\ub2e4.<br>\uc608) \\&#8221;, \\n(\uc904\ubc14\uafc8), \\(\uc5ed\uc2ac\ub798\uc26c)<\/p>\n\n\n\n<p>\u2605 \uc5f0\uc0b0\uc790<br>%: \ub098\uba38\uc9c0 \uc5f0\uc0b0\uc790. alert(10%7); =&gt; 3<\/p>\n\n\n\n<p>\u2605 \ubcf5\ud569 \ub300\uc785 \uc5f0\uc0b0\uc790<br>+= : \uae30\uc874 \ubcc0\uc218\uac12\uc5d0 \uac12\uc744 \ub354\ud55c\ub2e4.<br>\/= : \uae30\uc874 \ubcc0\uc218\uc758 \uac12\uc5d0 \uac12\uc744 \ub098\ub208\ub2e4.<\/p>\n\n\n\n<p>var title = &#8216;hello&#8217;;<br>title += &#8216; JavaScript!&#8217;;<br>document.body.innerHTML = title;<\/p>\n\n\n\n<p>\ubcc0\uc218++ : \uae30\uc874\uc758 \ubcc0\uc218 \uac12\uc5d0 1\uc744 \ub354\ud55c\ub2e4.(\ud6c4\uc704)<br>++\ubcc0\uc218 : \uae30\uc874\uc758 \ubcc0\uc218 \uac12\uc5d0 1\uc744 \ub354\ud55c\ub2e4.(\uc804\uc704)<\/p>\n\n\n\n<p>var sum = 10;<br>alert(sum++); =&gt; 10. \uc65c\ub0d0\ud558\uba74 \ucd9c\ub825\uc744 \uba3c\uc800\ud558\uace0 \ub098\uc911\uc5d0 \ub354\ud558\uae30 \ub54c\ubb38.<\/p>\n\n\n\n<p>\u2605 \ubd88 \uc790\ub8cc\ud615<br>alert(52&gt;138); =&gt; false<br>\uac00\ubc29&gt;\ud558\ub9c8 =&gt; false \/\/\uad6d\uc5b4\uc0ac\uc804 \uc55e\ucabd\uc5d0 \uc788\uc744\uc218\ub85d \uac12\uc774 \uc791\ub2e4.<br>alert(!true); =&gt; false<\/p>\n\n\n\n<p>&amp;&amp;: \ub17c\ub9ac\uacf1 \uc5f0\uc0b0\uc790. \ub2e4 \ucc38\uc774\ub77c\uc57c \ucc38<br>||: \ub17c\ub9ac\ud569 \uc5f0\uc0b0\uc790. \uc5ec\ub7ec \uac1c \uc911 \ud558\ub098\ub9cc\uc774\ub77c\ub3c4 \ucc38\uc774\uba74 \ucc38<br>alert(30&gt;20 &amp;&amp; 20&gt;10); =&gt; alert(true &amp;&amp; true); =&gt; alert(true);<\/p>\n\n\n\n<p>\u2605 \ubcc0\uc218: \uac12\uc744 \uc800\uc7a5\ud560 \ub54c \uc0ac\uc6a9\ud558\ub294 \uc2dd\ubcc4\uc790<br>var pi = 3.14159265;<\/p>\n\n\n\n<p>\u2605 \uc790\ub8cc\ud615 \uac80\uc0ac<br>alert(typeof (&#8216;String&#8217;)); =&gt; string<br>alert(typeof (255)); =&gt; number<\/p>\n\n\n\n<p>\u2605 \uc774\ud56d\uc5f0\uc0b0\uc790\uc640 \ub2e8\ud56d\uc5f0\uc0b0\uc790<br>\uc774\ud56d\uc5f0\uc0b0\uc790: 52 + 30\ucc98\ub7fc \ud56d\uc774 \ub450\uac1c \uc5f0\uc0b0\uc790 \ud558\ub098.<br>\ub2e8\ud56d\uc5f0\uc0b0\uc790: -52, typeof 52\ucc98\ub7fc \ud56d\uc774 \ud558\ub098, \uc5f0\uc0b0\uc790 \ud558\ub098.<\/p>\n\n\n\n<p>\u2605 prompt() \ud568\uc218<br>var val = prompt(&#8216;question&#8217;,&#8217;answer&#8217;);<br>alert(val); \uc774 \ucf54\ub4dc\ub97c \uc2e4\ud589\ud558\uba74 \uc0ac\uc6a9\uc790\uc5d0\uac8c \uc785\ub825\uc744 \uc694\uad6c\ud558\ub294 \uc785\ub825\ucc3d\uc774 \ub72c\ub2e4.<br>\uc785\ub825\ud55c \uac12\uc774 \ub2e4\uc2dc \ucd9c\ub825\ub41c\ub2e4.<\/p>\n\n\n\n<p>\u2605 confirm() \ud568\uc218<br>var input = confirm(&#8216;\ub3d9\uc758\ud558\uc2ed\ub2c8\uae4c?&#8217;);<br>alert(input); \ud655\uc778\uc744 \ub204\ub974\uba74 true\ub97c \ub9ac\ud134\ud558\uace0 \ucde8\uc18c\ub97c \ub204\ub974\uba74 false\ub97c \ub9ac\ud134<\/p>\n\n\n\n<p>\u2605 \uc22b\uc790\uc640 \ubb38\uc790\uc5f4 \uc790\ub8cc\ud615 \ubcc0\ud658<br>alert(&#8216;1+2&#8217;) =&gt; 1+2 \ubb38\uc790\uc5f4<br>alert(1+2) =&gt; 3 \uc22b\uc790<br>alert(&#8216;1&#8217;+2) =&gt; 12 \ubb38\uc790\uc5f4<br>alert(&#8216;1<em>2&#8242;) =&gt; 1<\/em>2 \ubb38\uc790\uc5f4<br>alert(1<em>2) =&gt; 2 \uc22b\uc790 alert(&#8216;1&#8217;<\/em>2) =&gt; 2 \uc22b\uc790!! \uc22b\uc790\uac00 \uc6b0\uc120\ub41c\ub2e4.<\/p>\n\n\n\n<p>\u2605 Number(): \uac15\uc81c\ub85c \uc790\ub8cc\ud615\uc744 \ubcc0\ud658\ud55c\ub2e4.<br>var oldType = prompt(&#8216;\uc22b\uc790\ub97c \uc785\ub825\ud558\uc138\uc694&#8217;,&#8217;\uc22b\uc790&#8217;);<br>alert(typeof(oldType)); =&gt; \ubb38\uc790\uc5f4\uc774\ub77c\uace0 \ud568.<\/p>\n\n\n\n<p>var newType = Number(oldType);<br>alert(typeof(newType)); =&gt; \uc22b\uc790\ub77c\uace0 \ud568.<\/p>\n\n\n\n<p>\ub9cc\uc57d \uc22b\uc790\uac00 \uc544\ub2cc \uac12\uc744 \uc785\ub825\ud558\uba74 NaN\uc774\ub77c\uace0 \ub098\uc635\ub2c8\ub2e4. not a number<\/p>\n\n\n\n<p>\u2605 \ubd88 \uc790\ub8cc\ud615 \ubcc0\ud658<br>alert(Boolean(&#8216;a&#8217;)); =&gt; true<br>alert(Boolean(0)); =&gt; false<br>alert(Boolean(&#8221;)); =&gt; false<br>alert(Boolean(undefined)); =&gt; false<br>alert(Boolean(NaN)); =&gt; false\ucd9c\ub825. \uc22b\uc790\ud615\uc778\ub370 \uc22b\uc790\ub85c \ud45c\ud604\ud560 \uc218 \uc5c6\ub2e4\uba74 NaN.<\/p>\n\n\n\n<p>\uc22b\uc790\uc544\ub2cc \ubb38\uc790\ub97c \uc785\ub825\ud558\uba74 \uc791\ub3d9\uc548\ub418\ub294 \ud504\ub85c\uadf8\ub7a8\uc5d0 \uc4f0\uc778\ub2e4.<\/p>\n\n\n\n<p><a href=\"\/example\/j\/WeightCalculator.php\" data-type=\"URL\" data-id=\"\/example\/j\/WeightCalculator.php\">\uc608\uc81c\ub9c1\ud06c<\/a><\/p>\n\n\n\n<p>\u2605 null\uacfc undefined\uc758 \ucc28\uc774<br>\uac1c\ubc1c\uc790\uac00 \uba85\uc2dc\uc801\uc73c\ub85c \uac12\uc774 \ube44\uc5b4\uc788\uc74c\uc744 \ub098\ud0c0\ub0b4\uae30 \uc704\ud574 null \ud0c0\uc785 \ubcc0\uc218\ub97c \uc0ac\uc6a9\ud55c\ub2e4.<br>\uc758\ub3c4\uc801\uc778 \ud0c0\uc785.<\/p>\n\n\n\n<p>\u2605 \uc77c\uce58 \uc5f0\uc0b0\uc790<br>alert(&#8221; == false); =&gt; \uc790\ub3d9\uc73c\ub85c \uc790\ub8cc\ud615\uc774 \ubcc0\ud658\ub418\uc5b4 true\ucd9c\ub825<br>alert(&#8221; === false); =&gt; false\ucd9c\ub825<br>alert(&#8216;255&#8217; == 255); =&gt; true<br>alert(&#8216;255&#8217; === 255); =&gt; false<\/p>\n\n\n\n<p>\uc77c\uce58\uc5f0\uc0b0\uc790\ub97c \ud1b5\ud574 \ud0c0\uc785\uc744 \ud655\uc778\ud560 \uc218 \uc788\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u2605 \uc2dd\ubcc4\uc790 1. \ud0a4\uc6cc\ub4dc(return), \uc22b\uc790\ub85c \uc2dc\uc791\ub418\uac70\ub098(3content), \ube48\uce78\uc774 \uc788\uac70\ub098(no value)\ub294 \uc2dd\ubcc4\uc790\ub85c \uc4f8 \uc218 \uc5c6\ub2e4. 2. \uc0dd\uc131\uc790 \ud568\uc218\uc758 \uc774\ub984\uc740 \ud56d\uc0c1 \ub300\ubb38\uc790\ub85c \uc2dc\uc791\ud55c\ub2e4. 3. \ubcc0\uc218\uc640 \uc778\uc2a4\ud134\uc2a4, \ud568\uc218, \uba54\uc11c\ub4dc\uc758 \uc774\ub984\uc740 \ud56d\uc0c1 \uc18c\ubb38\uc790\ub85c \uc2dc\uc791\ud55c\ub2e4. 4. \uc5ec\ub7ec \ub2e8\uc5b4\ub85c \uc774\ub8e8\uc5b4\uc9c4 \uc2dd\ubcc4\uc790\ub294 \uac01 \ub2e8\uc5b4\uc758 \uccab \uae00\uc790\ub97c \ub300\ubb38\uc790\ub85c \ud55c\ub2e4. \u2605 \uc2dd\ubcc4\uc790\uc758 \uc885\ub958\uba54\uc11c\ub4dc : \uc2dd\ubcc4\uc790 \ub4a4\uc5d0 \uad04\ud638\uc788\uc74c | \uc5b4\ub5a4 \ub300\uc0c1\uc774 <a href=\"https:\/\/trret.com\/?p=130\" class=\"btn btn-link continue-link\">\ub354 \uc77d\uae30<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12],"tags":[],"_links":{"self":[{"href":"https:\/\/trret.com\/index.php?rest_route=\/wp\/v2\/posts\/130"}],"collection":[{"href":"https:\/\/trret.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trret.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trret.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=130"}],"version-history":[{"count":7,"href":"https:\/\/trret.com\/index.php?rest_route=\/wp\/v2\/posts\/130\/revisions"}],"predecessor-version":[{"id":153,"href":"https:\/\/trret.com\/index.php?rest_route=\/wp\/v2\/posts\/130\/revisions\/153"}],"wp:attachment":[{"href":"https:\/\/trret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trret.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}