{"id":267,"date":"2020-02-04T20:34:12","date_gmt":"2020-02-04T12:34:12","guid":{"rendered":"https:\/\/blog.cqdefxxx.com\/?p=267"},"modified":"2020-02-04T20:34:12","modified_gmt":"2020-02-04T12:34:12","slug":"%e8%87%aa%e5%a2%9e%e5%92%8c%e8%87%aa%e5%87%8f","status":"publish","type":"post","link":"https:\/\/blog.viter.top\/index.php\/2020\/02\/04\/%e8%87%aa%e5%a2%9e%e5%92%8c%e8%87%aa%e5%87%8f\/","title":{"rendered":"\u81ea\u589e\u548c\u81ea\u51cf"},"content":{"rendered":"<pre class=\"pure-highlightjs\"><code class=\"\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n\t&lt;head&gt;\n\t\t&lt;meta charset=\"UTF-8\"&gt;\n\t\t&lt;title&gt;&lt;\/title&gt;\n\t\t&lt;script type=\"text\/javascript\"&gt;\n\t\t\t\n\t\t\t\/*\n\t\t\t * \u81ea\u589e ++\n\t\t\t * \t - \u901a\u8fc7\u81ea\u589e\u53ef\u4ee5\u4f7f\u53d8\u91cf\u5728\u81ea\u8eab\u7684\u57fa\u7840\u4e0a\u589e\u52a01\n\t\t\t * \t - \u5bf9\u4e8e\u4e00\u4e2a\u53d8\u91cf\u81ea\u589e\u4ee5\u540e\uff0c\u539f\u53d8\u91cf\u7684\u503c\u4f1a\u7acb\u5373\u81ea\u589e1\n\t\t\t * \t - \u81ea\u589e\u5206\u6210\u4e24\u79cd\uff1a\u540e++(a++) \u548c \u524d++(++a)\t\n\t\t\t * \t\t\u65e0\u8bba\u662fa++ \u8fd8\u662f ++a\uff0c\u90fd\u4f1a\u7acb\u5373\u4f7f\u539f\u53d8\u91cf\u7684\u503c\u81ea\u589e1\n\t\t\t * \t\t\t\u4e0d\u540c\u7684\u662fa++ \u548c ++a\u7684\u503c\u4e0d\u540c\n\t\t\t * \t\ta++\u7684\u503c\u7b49\u4e8e\u539f\u53d8\u91cf\u7684\u503c\uff08\u81ea\u589e\u524d\u7684\u503c\uff09\n\t\t\t * \t\t++a\u7684\u503c\u7b49\u4e8e\u65b0\u503c \uff08\u81ea\u589e\u540e\u7684\u503c\uff09\n\t\t\t * \n\t\t\t * \u81ea\u51cf --\n\t\t\t * \t- \u901a\u8fc7\u81ea\u51cf\u53ef\u4ee5\u4f7f\u53d8\u91cf\u5728\u81ea\u8eab\u7684\u57fa\u7840\u4e0a\u51cf1\n\t\t\t * \t- \u81ea\u51cf\u5206\u6210\u4e24\u79cd\uff1a\u540e--(a--) \u548c \u524d--(--a)\n\t\t\t * \t\t\u65e0\u8bba\u662fa-- \u8fd8\u662f --a \u90fd\u4f1a\u7acb\u5373\u4f7f\u539f\u53d8\u91cf\u7684\u503c\u81ea\u51cf1\n\t\t\t * \t\t\t\u4e0d\u540c\u7684\u662fa-- \u548c --a\u7684\u503c\u4e0d\u540c\n\t\t\t * \t\t\t\ta-- \u662f\u53d8\u91cf\u7684\u539f\u503c \uff08\u81ea\u51cf\u524d\u7684\u503c\uff09\n\t\t\t * \t\t\t\t--a \u662f\u53d8\u91cf\u7684\u65b0\u503c \uff08\u81ea\u51cf\u4ee5\u540e\u7684\u503c\uff09\n\t\t\t * \t\t\t\n\t\t\t * \t\n\t\t\t *\/\n\t\t\t\n\t\t\tvar num = 10;\n\t\t\t\n\t\t\t\/\/num--;\n\t\t\t\/\/--num;\n\t\t\t\n\t\t\t\/\/console.log(num--);\n\t\t\tconsole.log(--num);\n\t\t\t\n\t\t\tconsole.log(\"num = \"+num);\n\t\t\t\n\t\t\t\n\t\t\tvar a = 1;\n\t\t\t\n\t\t\t\/\/\u4f7fa\u81ea\u589e1\n\t\t\t\/\/a++;\n\t\t\t\/\/++a;\n\t\t\t\n\t\t\t\/\/console.log(a++);\n\t\t\t\n\t\t\t\/\/console.log(\"++a = \" + ++a);\n\t\t\t\/*console.log(\"a++ = \" + a++);\n\t\t\t\n\t\t\tconsole.log(\"a = \"+a);*\/\n\t\t\t\n\t\t\t\n\t\t\tvar c = 10;\n\t\t\t\n\t\t\t\/\/\u7b2c\u4e00\u6b21c++\uff0c\u662f\u572810\u7684\u57fa\u7840\u4e0a\u81ea\u589e\n\t\t\t\/\/console.log(c++);\n\t\t\t\n\t\t\t\/\/\u7b2c\u4e8c\u6b21c++\uff0c\u662f\u572811\u7684\u57fa\u7840\u4e0a\u81ea\u589e\n\t\t\tc++;\n\t\t\t\n\t\t\tvar d = 20;\n\t\t\t\n\t\t\t\/\/console.log(++d);\/\/21\n\t\t\t\/\/console.log(++d);\/\/22\n\t\t\t\n\t\t\t\/\/20 + 22 + 22\n\t\t\t\/\/var result = d++ + ++d + d ;\n\t\t\t\n\t\t\t\n\t\t\t\/\/d = 20\n\t\t\td = d++;\n\t\t\t\n\t\t\t\/*\n\t\t\t * var e = d++;\n\t\t\t * d = e;\n\t\t\t *\/\n\t\t\t\n\t\t\t\/\/console.log(\"d = \"+d);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t&lt;\/script&gt;\n\t\t\n\t&lt;\/head&gt;\n\t&lt;body&gt;\n\t&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n<h1>\u7ec3\u4e60\uff1a<\/h1>\n<pre class=\"pure-highlightjs\"><code class=\"\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n\t&lt;head&gt;\n\t\t&lt;meta charset=\"UTF-8\"&gt;\n\t\t&lt;title&gt;&lt;\/title&gt;\n\t\t&lt;script type=\"text\/javascript\"&gt;\n\t\t\n\t\t\tvar n1=10;\n\t\t\tvar n2=20;\n\t\t\t\n\t\t\tvar n = n1++; \/\/n1 = 11  n1++ = 10\n\t\t\t\n\t\t\tconsole.log('n='+n);  \/\/ 10\n\t\t\tconsole.log('n1='+n1); \/\/11\n\t\t\t\n\t\t\tn = ++n1 \/\/n1 = 12  ++n1 =12\n\t\t\tconsole.log('n='+n); \/\/12\n\t\t\tconsole.log('n1='+n1); \/\/12\n\t\t\t\n\t\t\tn = n2--;\/\/ n2=19 n2--=20\n\t\t\tconsole.log('n='+n); \/\/20\n\t\t\tconsole.log('n2='+n2); \/\/19\n\t\t\t\n\t\t\tn = --n2; \/\/n2=18 --n2 = 18\n\t\t\tconsole.log('n='+n); \/\/18\n\t\t\tconsole.log('n2='+n2); \/\/18\n\t\t\t\n\t\t\t\n\t\t&lt;\/script&gt;\n\t&lt;\/head&gt;\n\t&lt;body&gt;\n\t&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset= &#8230;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[4],"_links":{"self":[{"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/posts\/267"}],"collection":[{"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/comments?post=267"}],"version-history":[{"count":0,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/posts\/267\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/media?parent=267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/categories?post=267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/tags?post=267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}