{"id":737,"date":"2012-04-06T08:41:31","date_gmt":"2012-04-06T08:41:31","guid":{"rendered":"http:\/\/brain.dailyon.net\/?p=737"},"modified":"2012-04-06T08:41:31","modified_gmt":"2012-04-06T08:41:31","slug":"js-operator-%ec%97%b0%ec%82%b0%ec%9e%90","status":"publish","type":"post","link":"https:\/\/blog.goorigo.com\/?p=737","title":{"rendered":"JS : Operator (\uc5f0\uc0b0\uc790)"},"content":{"rendered":"<p><strong>the strict equal operator (<\/strong>\uc5c4\uaca9\ud55c \ube44\uad50 \uc5f0\uc0b0\uc790 )<\/p>\n<p>\ub370\uc774\ud130\uac00 \uac19\uc740 \ubfd0\ub9cc \uc544\ub2c8\ub77c, \uc790\ub8cc\ud615\uae4c\uc9c0 \uac19\uc744\ub54c!<\/p>\n<p>ex) var tmpStr = &#8220;1&#8221;; var tmpInt = 1;<\/p>\n<p>alert(tmpStr == tmpInt); \/\/true<\/p>\n<p>alert(tmpStr == tmpInt); \/\/false<\/p>\n<p>alert(tmpStr !== tmpInt); \/\/true<\/p>\n<p>=== This is <strong>the strict equal operator <\/strong>and only returns a Boolean true if both the operands are equal and of the same type. These next examples return true:<\/p>\n<p>!== This is <strong>the strict not equal operator<\/strong> and only returns a value of true if both the operands are not equal and\/or not of the same type. The following examples return a Boolean true:<\/p>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td valign=\"bottom\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div>\n<p><strong>1. \uc0b0\uc220 \uc5f0\uc0b0\uc790<\/strong><\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"121\">?\uc5f0\uc0b0\uc790<\/td>\n<td width=\"121\">?\uc124\uba85<\/td>\n<td width=\"121\">?\uc720\ud615<\/td>\n<td width=\"121\">?\ud615\uc2dd<\/td>\n<\/tr>\n<tr>\n<td width=\"121\">?+<\/td>\n<td width=\"121\">?\ub354\ud558\uae30<\/td>\n<td width=\"121\">?\uc774\ud56d<\/td>\n<td width=\"121\">?x + y<\/td>\n<\/tr>\n<tr>\n<td width=\"121\">?-<\/td>\n<td width=\"121\">?\ube7c\uae30<\/td>\n<td width=\"121\">?\uc774\ud56d<\/td>\n<td width=\"121\">?x &#8211; y<\/td>\n<\/tr>\n<tr>\n<td width=\"121\">?*<\/td>\n<td width=\"121\">?\uacf1\ud558\uae30<\/td>\n<td width=\"121\">?\uc774\ud56d<\/td>\n<td width=\"121\">?x * y<\/td>\n<\/tr>\n<tr>\n<td width=\"121\">?\/<\/td>\n<td width=\"121\">?\ub098\ub204\uae30<\/td>\n<td width=\"121\">?\uc774\ud56d<\/td>\n<td width=\"121\">?x \/ y<\/td>\n<\/tr>\n<tr>\n<td width=\"121\">?%<\/td>\n<td width=\"121\">?\ub098\uba38\uc9c0<\/td>\n<td width=\"121\">?\uc774\ud56d<\/td>\n<td width=\"121\">?x % y<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#8211; \uc774\ud56d \uc5f0\uc0b0\uc790 : \ud53c\uc5f0\uc0b0\uc790\uac00 \ub450 \uac1c \ud544\uc694\ud55c \uc5f0\uc0b0\uc790 (\uc608 : +, -)<\/p>\n<p>\uc608) var res = 10 + 20;<\/p>\n<p>\u203b \ub098\ub204\uae30 \uc5f0\uc0b0\uc790\uc640 \ub098\uba38\uc9c0 \uc5f0\uc0b0\uc790\uc758 \ucc28\uc774<\/p>\n<p>-?\ub098\ub204\uae30 \uc5f0\uc0b0\uc790 \uac12\uc740 \ub098\ub208 \uac12 \uc790\uccb4\uc758 \uac12\uc774\ub2e4<\/p>\n<p>&#8211; \ub098\uba38\uc9c0 \uc5f0\uc0b0\uc790 \uac12\uc740 \ub098\ub208 \ud6c4 \ub0a8\uc740 \ub098\uba38\uc9c0 \uac12\uc774\ub2e4<\/p>\n<p>&nbsp;<\/p>\n<p><strong>2. \uc99d\uac10 \uc5f0\uc0b0\uc790<\/strong><\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>?\uc5f0\uc0b0\uc790<\/td>\n<td>?\uc124\uba85<\/td>\n<td>?\uc720\ud615<\/td>\n<td>?\ud615\uc2dd<\/td>\n<\/tr>\n<tr>\n<td>?++<\/td>\n<td>?\uc99d\uac00<\/td>\n<td>?\ub2e8\ud56d<\/td>\n<td>?x++, ++x<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"1\" colspan=\"1\">?&#8211;<\/td>\n<td rowspan=\"1\" colspan=\"1\">?\uac10\uc18c<\/td>\n<td rowspan=\"1\" colspan=\"1\">?\ub2e4\ub0b3\u3147<\/td>\n<td rowspan=\"1\" colspan=\"1\">?y&#8211;, &#8211;y<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#8211; \ub2e8\ud56d \uc5f0\uc0b0\uc790 : \ud53c\uc5f0\uc0b0\uc790\uac00 \ud558\ub098\ub9cc \ud544\uc694\ud55c \uc5f0\uc0b0\uc790 (\uc608 : ++, &#8211;)<\/p>\n<p>\uc608) var a = 1<\/p>\n<p>var?b = ++a (a \uac12\uc744 b\uc5d0 \ud560\ub2f9\ud55c\ub2e4, a\uac12\uc744 1 \uc99d\uac00\uc2dc\ud0a8\ub2e4)<\/p>\n<p>document.write (&#8220;a\ub294 &#8220;, a, &#8220;\uc774\uace0b\ub294 &#8220;, b)<\/p>\n<p>\ub2f5 : a\ub294 2 \uc774\uace0 b\ub294 2<\/p>\n<p>&nbsp;<\/p>\n<p><strong>3. \ub300\uc785 \uc5f0\uc0b0\uc790<\/strong><\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<p align=\"center\">?\ud615\uc2dd<\/p>\n<\/td>\n<td rowspan=\"1\" colspan=\"2\">\n<p align=\"center\">?\uc124\uba85<\/p>\n<\/td>\n<td>?\ud615\uc2dd<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">?=<\/p>\n<\/td>\n<td rowspan=\"1\" colspan=\"2\">?\uc5f0\uc0b0\uc790 \uc624\ub978\ucabd \uac12\uc744 \uc67c\ucabd \ubcc0\uc218\uc5d0 \ub300\uc785\ud569\ub2c8\ub2e4<\/td>\n<td>?x = y<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">?-=<\/p>\n<\/td>\n<td rowspan=\"1\" colspan=\"2\">?OP1 = OP1 &#8211; OP2<\/td>\n<td>?X = Y<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">?+=<\/p>\n<\/td>\n<td rowspan=\"1\" colspan=\"2\">?OP1 = OP1 + OP2<\/td>\n<td>?X+ = Y<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">?*=<\/p>\n<\/td>\n<td rowspan=\"1\" colspan=\"2\">?OP1 = OP1 * OP2<\/td>\n<td>?X* = Y<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">?\/=<\/p>\n<\/td>\n<td rowspan=\"1\" colspan=\"2\">?OP1 = OP1 \/ OP2<\/td>\n<td>?X\/ = Y<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">?%=<\/p>\n<\/td>\n<td rowspan=\"1\" colspan=\"2\">?OP1 = OP1 % OP2<\/td>\n<td>?X% = Y<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\uc608) var i = 10 + 20;<\/p>\n<p>i += 3;<\/p>\n<p>\ub2f5 : 33<\/p>\n<p>&nbsp;<\/p>\n<p><strong>4. \ube44\uad50 \uc5f0\uc0b0\uc790<\/strong><\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>?\ud615\uc2dd<\/td>\n<td rowspan=\"1\" colspan=\"2\">?\uc124\uba85<\/td>\n<td>?\ud615\uc2dd<\/td>\n<\/tr>\n<tr>\n<td>?==<\/td>\n<td rowspan=\"1\" colspan=\"2\">?\uac19\uc740\uc9c0 \ube44\uad50<\/td>\n<td>?x == y<\/td>\n<\/tr>\n<tr>\n<td>?!=<\/td>\n<td rowspan=\"1\" colspan=\"2\">?\uac19\uc9c0 \uc54a\uc740\uc9c0 \ube44\uad50<\/td>\n<td>?x != y<\/td>\n<\/tr>\n<tr>\n<td>?&lt;<\/td>\n<td rowspan=\"1\" colspan=\"2\">?\uc791\uc740\uc9c0 \ube44\uad50<\/td>\n<td>?x &lt; y<\/td>\n<\/tr>\n<tr>\n<td>?&lt;=<\/td>\n<td rowspan=\"1\" colspan=\"2\">?\uc791\uac70\ub098 \uac19\uc740\uc9c0 \ube44\uad50<\/td>\n<td>?x &lt;= y<\/td>\n<\/tr>\n<tr>\n<td>?&gt;<\/td>\n<td rowspan=\"1\" colspan=\"2\">?\ud070\uc9c0 \ube44\uad50<\/td>\n<td>?x &gt; y<\/td>\n<\/tr>\n<tr>\n<td>?&gt;=<\/td>\n<td rowspan=\"1\" colspan=\"2\">?\ud06c\uac70\ub098 \uac19\uc740\uc9c0 \ube44\uad50<\/td>\n<td>?x &gt;= y<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\ube44\uad50 \uc5f0\uc0b0\uc790 : \ub450 \uac00\uc9c0 \uc218\ub098 \ubb38\uc790\uc5f4\uc744 \ube44\uad50\ud560 \ub54c \uc0ac\uc6a9\ud558\ub294 \uc5f0\uc0b0\uc790<\/p>\n<p>\uc67c\ucabd \ud53c\uc5f0\uc0b0\uc790\uc5d0 \ub300\ud558\uc5ec \uc624\ub978\ucabd \ud53c\uc5f0\uc0b0\uc790\uc640\uc758 \uc870\uac74\uc744 \ud310\ub2e8\ud558\ub294 \uc5f0\uc0b0\uc790<\/p>\n<p>\uc608) var i = 10 + 20;<\/p>\n<p>if (i == 30) \/\/ i\uac12\uc774 30\uacfc \uac19\uc73c\uba74 &#8216;\ucc38&#8217;\uc744 \ucd9c\ub825<\/p>\n<p>document.write(&#8220;\ucc38&#8221;);<\/p>\n<p>&nbsp;<\/p>\n<p><strong>5. \ub17c\ub9ac \uc5f0\uc0b0\uc790<\/strong><\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>?\uc5f0\uc0b0\uc790<\/td>\n<td>?\uc124\uba85<\/td>\n<\/tr>\n<tr>\n<td>?ll (OR)<\/td>\n<td>?\ud53c\uc5f0\uc0b0\uc790 \uc911 true\uac00 \ud558\ub098\ub77c\ub3c4 \uc788\uc73c\uba74 true\uac00 \ub429\ub2c8\ub2e4<\/td>\n<\/tr>\n<tr>\n<td>?&amp;&amp; (AND)<\/td>\n<td>?\ud53c\uc5f0\uc0b0\uc790 \uc911 false\uac00 \ud558\ub098\ub77c\ub3c4 \uc788\uc73c\uba74 false\uac00 \ub429\ub2c8\ub2e4<\/td>\n<\/tr>\n<tr>\n<td>?! (NOT)<\/td>\n<td>?\ud53c\uc5f0\uc0b0\uc790\uc758 \uac12\uacfc \uc815\ubc18\ub300\uc758 \uac12\uc744 \uac00\uc9d1\ub2c8\ub2e4.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\ub17c\ub9ac \uc5f0\uc0b0\uc790 : \ucc38\uacfc \uac70\uc9d3\uc744 \uad6c\ubcc4\ud558\ub294 \uc5f0\uc0b0\uc790<\/p>\n<p>\uc608)<\/p>\n<p>&lt;HTML&gt;<br \/>\n&lt;HEAD&gt;<br \/>\n&lt;TITLE&gt;\uc131\ubcc4\uacfc \ub098\uc774 \ud655\uc778\ud558\uae30&lt;\/TITLE&gt;<br \/>\n&lt;SCRIPT LANGUAGE=&#8221;Javascript&#8221;&gt;<br \/>\n&lt;!&#8211;<br \/>\nsex = prompt(&#8220;\ub2f9\uc2e0\uc740 \ub0a8\uc790\uc785\ub2c8\uae4c?? (\uc5ec\uc790 : 0, \ub0a8\uc790 : 1)&#8221;, &#8220;1&#8221;)<br \/>\nage = prompt(&#8220;\ub098\uc774\uac00 20\uc138 \uc774\uc0c1\uc785\ub2c8\uae4c?? (20\uc138 \ubbf8\ub9cc : 0, 20\uc138 \uc774\uc0c1 : 1)&#8221;, &#8220;1&#8221;)<br \/>\nif? ((sex==1)? &amp;&amp;? (age==1))? document.write(&#8220;\ub2f9\uc2e0\uc740 20\uc138 \uc774\uc0c1\uc758 \ub0a8\uc790\uad70\uc694.&lt;BR&gt;&#8221;)<br \/>\nif(!(sex==1)) document.write(&#8220;\ub2f9\uc2e0\uc740 \uc5ec\uc790\uad70\uc694.&lt;BR&gt;&#8221;)<br \/>\nif(!(age==1)) document.write(&#8220;\uc544\uc9c1 20\uc138\uac00 \uc548\ub42c\uad70\uc694.&#8221;)<br \/>\n\/\/ &#8211; &#8211; &gt;<br \/>\n&lt;\/SCRIPT&gt;<br \/>\n&lt;\/HEAD&gt;<br \/>\n&lt;BODY&gt;<br \/>\n&lt;\/BODY&gt;<br \/>\n&lt;\/HTML&gt;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>6. \ube44\ud2b8\uc5f0\uc0b0\uc790 : \ub450 \uac00\uc9c0 \uc218\ub098 \ubb38\uc790\uc5f4\uc744 \ube44\uad50\ud560 \ub54c \uc0ac\uc6a9\ud558\ub294 \uc5f0\uc0b0\uc790<\/strong><\/p>\n<p>&#8211; \uc26c\ud504\ud2b8 \uc5f0\uc0b0\uc790<\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"242\">?&gt;&gt;<\/td>\n<td width=\"242\">?\uc624\ub978\ucabd\uc73c\ub85c \uc774\ub3d9<\/td>\n<\/tr>\n<tr>\n<td width=\"242\">?&lt;&lt;<\/td>\n<td width=\"242\">?\uc67c\ucabd\uc73c\ub85c \uc774\ub3d9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\uc2ed\uc9c4\uc218 6\uc744 \ube44\ud2b8\ub85c \ud45c\ud55c\ud558\uba74 110\uc774\ub2e4<\/p>\n<p>6 &gt;&gt; 2\uc758 \ud615\ud0dc\ub85c \uc26c\ud504\ud2b8 \uc5f0\uc0b0\uc790\ub97c \uc0ac\uc6a9\ud588\ub2e4\uba74 6\uc758 \ube44\ud2b8\ub97c 2\ub9cc\ud07c \uc624\ub978\ucabd\uc73c\ub85c \uc774\ub3d9\uc2dc\ud0a4\uac9f\ub2e4\ub294 \uc758\ubbf8<\/p>\n<p>\ube48 \uc790\ub9ac\ub294 0\uc73c\ub85c \ucc44\uc6cc\uc9c4\ub2e4<\/p>\n<p>\ub2f5 : 001<\/p>\n<p>&#8211; \ube44\ud2b8 \ub17c\ub9ac \uc5f0\uc0b0\uc790<\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"242\">?&amp;<\/td>\n<td width=\"242\">?AND<\/td>\n<\/tr>\n<tr>\n<td width=\"242\">?l<\/td>\n<td width=\"242\">?OR<\/td>\n<\/tr>\n<tr>\n<td width=\"242\">?^<\/td>\n<td width=\"242\">?XOR<\/td>\n<\/tr>\n<tr>\n<td width=\"242\">?~<\/td>\n<td width=\"242\">?NOT<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#8211; AND \uc5f0\uc0b0\uc790\ub294 \ub450\uac1c\uc758 \ube44\ud2b8\uac00 \ubaa8\ub450 1\uc774\uc5ec\ub9cc 1\uc758 \uac12\uc744 \uac00\uc9c8\uc218 \uc788\ub2e4<\/p>\n<p>&#8211; OR \uc5f0\uc0b0\uc790\ub294 \ub450\uac1c\uc758 \ube44\ud2b8\ub97c \ube44\uad50\ud574\uc11c \ub458\uc911 \ud558\ub098\ub9cc 1\uc774\uc5b4\ub3c4 \uacb0\uacfc\uac12\uc740 1\uc774 \ub41c\ub2e4<\/p>\n<p>&#8211; XOR \uc5f0\uc0b0\uc790\ub294 \uc11c\ub85c \ube44\uad50\ub418\ub294 \ube44\ud2b8\uac00 \ub2ec\ub77c\uc57c 1\uc774 \ub429\ub2c8\ub2e4<\/p>\n<p>&#8211; NOT \uc5f0\uc0b0\uc790\ub294 \ud53c\uc5f0\uc0b0\uc790 \uac12\uc758 \ubc18\ub300\uac12\uc740 \ubc18\ud658\ud55c\ub2e4<\/p>\n<p>&nbsp;<\/p>\n<p><strong>7. 3\ud56d \uc5f0\uc0b0\uc790 (\uc870\uac74 \uc5f0\uc0b0\uc790)<\/strong><\/p>\n<p>if\ubb38\uc744 \uac04\ub2e8\ud788 \ud55c\uc904\ub85c \ud45c\ud5cc\ud558\uae30\uc5d0 \uc88b\uc740 \uc5f0\uc0b0\uc790<\/p>\n<p>\ud615\uc2dd) \uc870\uac74 ? \ucc98\ub9ac1 : \ucc98\ub9ac2<\/p>\n<p>\uc608) var i = 10;<\/p>\n<p>i == 10 ? document.write(&#8220;\uc788\ub2e4&#8221;) : document.write(&#8220;\uc5c6\ub2e4.&#8221;);<\/p>\n<div>\n<p><strong>[\ucd9c\ucc98]<\/strong>?<a href=\"http:\/\/blog.naver.com\/tnt5642\/20153624568\" target=\"_blank\">JavaScript 3. \uc5f0\uc0b0\uc790<\/a>|<strong>\uc791\uc131\uc790<\/strong>?<a href=\"http:\/\/blog.naver.com\/tnt5642\" target=\"_blank\">\uc774\ubed0\uc9c8\ub798<\/a><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>the strict equal operator (\uc5c4\uaca9\ud55c \ube44\uad50 \uc5f0\uc0b0\uc790 ) \ub370\uc774\ud130\uac00 \uac19\uc740 \ubfd0\ub9cc \uc544\ub2c8\ub77c, \uc790\ub8cc\ud615\uae4c\uc9c0 \uac19\uc744\ub54c! ex) var tmpStr = &#8220;1&#8221;; var tmpInt = 1; alert(tmpStr == tmpInt); \/\/true alert(tmpStr == tmpInt);&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/posts\/737"}],"collection":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=737"}],"version-history":[{"count":0,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=\/wp\/v2\/posts\/737\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.goorigo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}