{"id":619,"date":"2008-10-28T10:10:56","date_gmt":"2008-10-28T02:10:56","guid":{"rendered":"http:\/\/fdream.net\/blog\/article\/619.aspx"},"modified":"2008-10-28T11:10:42","modified_gmt":"2008-10-28T03:10:42","slug":"JavaScript%e7%b1%bb%e5%9e%8b%e8%bd%ac%e6%8d%a2%e5%a4%aa%e5%8f%98%e6%80%81%ef%bc%8c%e6%85%8e%e7%94%a8","status":"publish","type":"post","link":"https:\/\/fdream.net\/blog\/article\/619","title":{"rendered":"JavaScript\u7c7b\u578b\u8f6c\u6362\u592a\u53d8\u6001\uff0c\u614e\u7528"},"content":{"rendered":"<p>JavaScript\u7684\u662f\u5f31\u7c7b\u578b\u7684\uff0c\u4f46\u662f\u5728\u5f88\u591a\u64cd\u4f5c\u4e2d\uff0c\u5b83\u4f1a\u81ea\u52a8\u8fdb\u884c\u76f8\u5e94\u7684\u7c7b\u578b\u8f6c\u6362\uff0c\u53ef\u80fd\u5f88\u591a\u4eba\u90fd\u77e5\u9053\u4e0b\u9762\u8fd9\u6837\u7684\u53d8\u6001\u7c7b\u578b\u8f6c\u6362\uff1a<\/p>\n<p><pre lang=\"javascript\">\n\/\/ \u4e0b\u9762\u8fd9\u4e2a\u7b49\u4e8e80.8\nalert('88.8' - 8);\n\/\/ \u4e0b\u9762\u8fd9\u4e2a\u7b49\u4e8e'88.88'\nalert('88.8' + 8)\n<\/pre>\n<\/p>\n<p>\u4e0a\u9762\u7684\u8fd9\u4e2a\u5f88\u597d\u7406\u89e3\uff0cJavaScript\u5728\u505a\u51cf\u6cd5\u8fd0\u7b97\u65f6\uff0c\u4f1a\u81ea\u52a8\u628a\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3aNumber\uff0c\u5728\u505a\u52a0\u6cd5\u65f6\uff0c\u53ea\u8981\u662f\u548c\u5b57\u7b26\u4e32\u76f8\u52a0\uff0c\u90a3\u4e48\u80af\u5b9a\u4f1a\u628a\u6570\u5b57\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u3002\u4f46\u662f\uff0c\u4f46\u662f\u5f88\u5c11\u6709\u4eba\u77e5\u9053\u4e0b\u9762\u8fd9\u6837\u53d8\u6001\u7684\u7c7b\u578b\u8f6c\u6362\uff1a<\/p>\n<p><pre lang=\"javascript\">\nvar x = '0E8888';\nalert(x == 0);        \/\/ \u8fd9\u4e2a\u662ftrue\nif (x &gt;= 0) {\n    alert('x &gt;= 0');  \/\/ \u8fd9\u4e2a\u4e5f\u662ftrue\n}\nif (x &lt; 0) {\n    alert('x &lt; 0');\n}\n<\/pre>\n<\/p>\n<p>\u5982\u679c\u8bf4\u6211\u4eec\u8fd9\u6837\u7406\u89e3\uff1a\u5728\u505a\u6bd4\u8f83\u8fd0\u7b97\u65f6\uff0c\u4f1a\u81ea\u52a8\u628a\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6570\u5b57\uff0c\u6240\u4ee5&#8217;0E8888&#8217;\u88ab\u8f6c\u6362\u4e3a0\uff0c\u6240\u4ee5\u4e0a\u9762\u7684\u7ed3\u679c\u6ca1\u6709\u4efb\u4f55\u95ee\u9898\u3002\u90a3\u4e48\u4e0b\u9762\u7684\u5c31\u6ca1\u529e\u6cd5\u89e3\u91ca\u4e86\uff1a<\/p>\n<p><pre lang=\"javascript\">\nvar x = '0F8888';\nalert(x == 0);        \/\/ \u8fd9\u4e2a\u662ffalse\nif (x &gt;= 0) {\n    alert('x &gt;= 0');  \/\/ \u8fd9\u4e2a\u4e5f\u662ffalse\n}\nif (x &lt; 0) {\n    alert('x &lt; 0');   \/\/ \u8fd9\u4e2a\u8fd8\u662ffalse\n}\n<\/pre>\n<\/p>\n<p>Who can tell me\uff1f\u8fd9\u4e2a\u7c7b\u578b\u8f6c\u6362\u592a\u53d8\u6001\uff0c\u5b9e\u5728\u662f\u96be\u4ee5\u7422\u78e8\uff0c\u6240\u4ee5\u5728\u5199\u4ee3\u7801\u7684\u65f6\u5019\u8fd8\u662f\u8981\u5c0f\u5fc3\uff0c\u5c3d\u91cf\u8981\u6709\u660e\u786e\u7684\u7c7b\u578b\uff0c\u867d\u7136\u4e0d\u7528\u5199\u51fa\u6765\uff0c\u5fc3\u4e2d\u4e00\u5b9a\u8981\u9075\u5b88\u8fd9\u4e2a\u89c4\u77e9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JavaScript\u7684\u662f\u5f31\u7c7b\u578b\u7684\uff0c\u4f46\u662f\u5728\u5f88\u591a\u64cd\u4f5c\u4e2d\uff0c\u5b83\u4f1a\u81ea\u52a8\u8fdb\u884c\u76f8\u5e94\u7684\u7c7b\u578b\u8f6c\u6362\uff0c\u53ef\u80fd\u5f88\u591a\u4eba\u90fd\u77e5\u9053\u4e0b\u9762\u8fd9\u6837\u7684\u53d8\u6001\u7c7b\u578b\u8f6c\u6362\uff1a \/\/ \u4e0b\u9762\u8fd9\u4e2a\u7b49\u4e8e80.8 alert(&#8216;88.8&#8242; &#8211; 8); \/\/ \u4e0b\u9762\u8fd9\u4e2a\u7b49\u4e8e&#8217;88.88&#8217; alert(&#8216;88.8&#8217; + 8) \u4e0a\u9762\u7684\u8fd9\u4e2a\u5f88\u597d\u7406\u89e3\uff0cJavaScript\u5728\u505a\u51cf\u6cd5\u8fd0\u7b97\u65f6\uff0c\u4f1a\u81ea\u52a8\u628a\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3aNumber\uff0c\u5728\u505a\u52a0\u6cd5\u65f6\uff0c\u53ea\u8981\u662f\u548c\u5b57\u7b26\u4e32\u76f8\u52a0\uff0c\u90a3\u4e48\u80af\u5b9a\u4f1a\u628a\u6570\u5b57\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u3002\u4f46\u662f\uff0c\u4f46\u662f\u5f88\u5c11\u6709\u4eba\u77e5\u9053\u4e0b\u9762\u8fd9\u6837\u53d8\u6001\u7684\u7c7b\u578b\u8f6c\u6362\uff1a var x = &#8216;0E8888&#8217;; alert(x == 0); \/\/ \u8fd9\u4e2a\u662ftrue if (x &gt;= 0) { alert(&#8216;x &gt;= 0&#8217;); \/\/ \u8fd9\u4e2a\u4e5f\u662ftrue } if (x &lt; 0) { alert(&#8216;x &lt; 0&#8242;); } \u5982\u679c\u8bf4\u6211\u4eec\u8fd9\u6837\u7406\u89e3\uff1a\u5728\u505a\u6bd4\u8f83\u8fd0\u7b97\u65f6\uff0c\u4f1a\u81ea\u52a8\u628a\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u6570\u5b57\uff0c\u6240\u4ee5&#8217;0E8888&#8217;\u88ab\u8f6c\u6362\u4e3a0\uff0c\u6240\u4ee5\u4e0a\u9762\u7684\u7ed3\u679c\u6ca1\u6709\u4efb\u4f55\u95ee\u9898\u3002\u90a3\u4e48\u4e0b\u9762\u7684\u5c31\u6ca1\u529e\u6cd5\u89e3\u91ca\u4e86\uff1a var x = &#8216;0F8888&#8217;; alert(x == 0); \/\/ \u8fd9\u4e2a\u662ffalse if (x &gt;= 0) &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[104,20],"class_list":["post-619","post","type-post","status-publish","format-standard","hentry","category-coding","tag-JavaScript","tag-20"],"views":8858,"_links":{"self":[{"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/posts\/619","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/comments?post=619"}],"version-history":[{"count":0,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/posts\/619\/revisions"}],"wp:attachment":[{"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/media?parent=619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/categories?post=619"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/tags?post=619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}