{"id":105949,"date":"2026-09-16T12:56:27","date_gmt":"2026-09-16T04:56:27","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/105949.html"},"modified":"2026-09-16T12:56:27","modified_gmt":"2026-09-16T04:56:27","slug":"05-%e6%9d%a1%e4%bb%b6%e5%88%a4%e6%96%ad%ef%bc%9a-%e6%89%8d%e6%98%af%e6%ad%a3%e9%81%93%ef%bc%88if-else-%c2%b7-%e9%80%bb%e8%be%91%e8%bf%9e%e6%8e%a5%e8%af%8d-%c2%b7-%e4%b8%89%e5%85%83-%c2%b7-switch","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/105949.html","title":{"rendered":"05 \u6761\u4ef6\u5224\u65ad\uff1a=== \u624d\u662f\u6b63\u9053\uff08if\/else \u00b7 \u903b\u8f91\u8fde\u63a5\u8bcd \u00b7 \u4e09\u5143 \u00b7 switch\uff09"},"content":{"rendered":"<p>\u4e0a\u4e00\u7bc7&#xff1a;04 \u6570\u5b57\u4e0e\u5b57\u7b26\u4e32&#xff1a;&#043; \u53f7\u7684\u4e24\u526f\u9762\u5b54&#xff08;\u62fc\u63a5\u4e0e\u76f8\u52a0 \u00b7 NaN \u00b7 \u7c7b\u578b\u4e92\u8f6c \u00b7 \u6a21\u677f\u5b57\u7b26\u4e32&#xff09;<\/p>\n<hr \/>\n<h3>\u4e0a\u7bc7\u7ec3\u4e60\u53c2\u8003\u7b54\u6848<\/h3>\n<p>\u7ec3\u4e60 1&#xff08;\u624b\u52a8\u6a21\u62df&#xff09;&#xff1a;\u624b\u52a8\u6a21\u62df&#xff08;\u5148\u5199\u7b54\u6848\u518d\u56de\u8f66&#xff09;&#xff1a;\u201c10\u201d &#043; 5\u300110 &#043; 5 &#043; \u201c5\u201d\u3001\u201c10\u201d &#8211; 5\u3001\u201c3\u201d * \u201c4\u201d \u5404\u5f97\u4ec0\u4e48&#xff1f; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260916045625-6aaa2179ba81a.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u89c4\u5f8b\u6536\u53e3&#xff1a;\u53ea\u6709 &#043; \u9047\u6587\u5219\u6587&#xff0c;\u5176\u4ed6\u8fd0\u7b97\u7b26\u9047\u6587\u8f6c\u6570\u3002<\/p>\n<p>\u7ec3\u4e60 2&#xff08;\u9884\u6d4b\u518d\u9a8c\u8bc1&#xff09;&#xff1a;\u9884\u6d4b\u518d\u9a8c\u8bc1&#xff1a;Number(\u201c\u201d)\u3001Number(\u201c12 8\u201d)\u3001parseInt(\u201c12 8\u201d)\u3001parseFloat(\u201c3.5\u6298\u201d) \u7684\u7ed3\u679c\u5404\u662f\u4ec0\u4e48&#xff1f;\u54ea\u4e2a\u51fa\u4e4e\u4f60\u610f\u6599&#xff1f; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260916045626-6aaa217a2def8.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> Number(&#034;&#034;) \u5f97 0&#xff08;\u5386\u53f2\u51b3\u5b9a&#xff09;&#xff1b; Number(&#034;12 8&#034;) \u5f97 NaN\u2014\u2014\u4e2d\u95f4\u7684\u7a7a\u683c\u7b97\u6742\u8d28&#xff0c;\u4e25\u683c\u6d3e\u76f4\u63a5\u62d2\u7edd&#xff1b; parseInt(&#034;12 8&#034;) \u5f97 12\u2014\u2014\u8585\u5230\u7a7a\u683c\u5c31\u505c&#xff1b; parseFloat(&#034;3.5\u6298&#034;) \u5f97 3.5&#xff1b; \u51fa\u4e4e\u610f\u6599\u7684\u591a\u534a\u662f\u524d\u4e24\u4e2a&#xff1a;\u7a7a\u4e32\u53d8 0\u3001\u4e00\u4e2a\u7a7a\u683c\u5c31\u80fd\u6bd2\u6b7b Number\u3002<\/p>\n<p>\u7ec3\u4e60 3&#xff08;\u6539\u9020\u8981\u70b9&#xff09;&#xff1a;\u6539\u9020\u8981\u70b9&#xff1a;\u8d26\u5355\u52a0\u7b2c\u56db\u7b14\u9910\u8d39 \u201c128\u5143\u201d&#xff08;\u70e7\u70e4&#xff09;\u2014\u2014\u6570\u636e\u533a\u52a0\u4e00\u884c\u3001\u5408\u8ba1\u5904\u52a0\u4e00\u9879&#xff0c;\u91cd\u8dd1&#xff1b;\u987a\u4fbf\u89c2\u5bdf&#034;\u4e8b\u6545\u8fd8\u539f&#034;\u90a3\u884c\u8ddf\u7740\u53d8\u957f\u4e86\u591a\u5c11&#xff1b; \u6570\u636e\u533a\u52a0 const bill4 &#061; &#034;128\u5143&#034;; \u6d17\u51fa food4 &#061; parseFloat(bill4) \u5408\u8ba1\u52a0\u4e00\u9879\u2014\u2014&#034;\u4e8b\u6545\u8fd8\u539f&#034;\u90a3\u884c\u53d8\u6210 &#034;198\u5143225\u5143217\u5143128\u5143&#034;&#xff0c;\u53c8\u957f\u4e00\u622a \u6bcf\u52a0\u4e00\u7b14\u4e0d\u6d17\u7684\u8d26&#xff0c;\u9b3c\u8bdd\u5c31\u957f\u4e00\u622a\u3002<\/p>\n<p>\u7ec3\u4e60 4&#xff08;\u75ab\u82d7\u63ed\u6653&#xff09;&#xff1a;\u4eba\u5747 87.56 \u5143&#xff0c;\u9884\u7b97\u7ebf 90 \u5143\u2014\u2014\u201c\u8d85\u6ca1\u8d85&#034;\u662f\u4e2a\u662f\u975e\u9898&#xff0c;\u7a0b\u5e8f\u9760\u4ec0\u4e48\u56de\u7b54\u662f\u975e\u9898&#xff1f;\u63a7\u5236\u53f0\u8bd5\u8bd5 console.log(87.56 &gt; 90)&#xff1b;\u518d\u8bd5\u8bd5 console.log(\u201c10\u201d &lt; \u201c9\u201d)\u2014\u2014\u7ed3\u679c\u7adf\u7136\u662f true&#xff0c;10 \u4e3a\u4ec0\u4e48\u4f1a\u5c0f\u4e8e 9&#xff1f;05 \u7bc7\u63ed\u6653\u6bd4\u8f83\u8fd0\u7b97\u7b26\u7684\u5751&#xff0c;\u548c JS \u4e16\u754c\u6700\u91cd\u8981\u7684\u4e09\u6761\u7b49\u53f7\u3002 87.56 &gt; 90 \u5f97 false&#xff0c;\u6ca1\u8d85\u9884\u7b97&#xff0c;&#034;10&#034; &lt; &#034;9&#034; \u5f97 true\u2014\u2014\u6bd4\u8f83\u8fd0\u7b97\u7b26\u4e24\u8fb9\u90fd\u662f\u5b57\u7b26\u4e32\u65f6\u4e0d\u8f6c\u6570\u5b57&#xff0c;\u6539\u8d70\u5b57\u5178\u5e8f&#xff1a;\u50cf\u67e5\u5b57\u5178\u4e00\u6837\u9010\u5b57\u7b26\u6bd4&#xff0c;\u7b2c\u4e00\u4f4d &#034;1&#034; \u6392\u5728 &#034;9&#034; \u524d\u9762&#xff0c;\u4e8e\u662f &#034;10&#034; \u6574\u4f53&#034;\u5c0f\u4e8e\u201d &#034;9&#034;\u3002\u6559\u8bad&#xff1a;\u6570\u5b57\u6bd4\u8f83\u524d\u5148\u6d17\u7c7b\u578b\u3002\u4eca\u5929\u5c31\u628a&#034;\u6bd4\u8f83&#034;\u8fde\u540c&#034;\u5224\u65ad&#034;\u4e00\u6b21\u8bb2\u900f&#xff0c;\u987a\u4fbf\u7acb JS \u4e16\u754c\u6700\u91cd\u8981\u7684\u4e00\u6761\u519b\u89c4\u3002<\/p>\n<hr \/>\n<h3>\u4e00\u3001\u573a\u666f\u5f15\u5165&#xff1a;\u8def\u53e3\u4e0e\u88c1\u5224<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260916045626-6aaa217a44b23.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u524d\u56db\u7bc7\u7684\u7a0b\u5e8f\u90fd\u662f\u4e00\u6761\u9053\u8d70\u5230\u9ed1\u2014\u2014\u4ece\u4e0a\u5230\u4e0b\u6bcf\u884c\u90fd\u6267\u884c\u3002\u4f46\u771f\u5b9e\u4e16\u754c\u5904\u5904\u662f\u5c94\u8def\u53e3&#xff1a;\u6210\u7ee9 85 \u8d70&#034;\u826f\u597d&#034;\u5c94\u53e3&#xff0c;59 \u8d70&#034;\u8865\u8003&#034;\u5c94\u53e3&#xff1b;\u5bc6\u7801\u5bf9\u8d70&#034;\u653e\u884c&#034;&#xff0c;\u9519\u8d70&#034;\u91cd\u8bd5&#034;\u3002\u7a0b\u5e8f\u7684&#034;\u806a\u660e&#034;\u4ece\u4eca\u5929\u5f00\u59cb&#xff1a;\u8ba9\u4ee3\u7801\u81ea\u5df1\u9009\u8def\u3002<\/p>\n<p>\u672c\u7bc7\u8fd8\u8981\u7acb\u4e00\u6761 JS \u7279\u6709\u7684\u519b\u89c4&#xff1a;\u5224\u65ad\u76f8\u7b49\u6c38\u8fdc\u7528\u4e09\u4e2a\u7b49\u53f7 &#061;&#061;&#061;\u3002\u7528\u4e24\u4e2a\u7b49\u53f7&#xff0c;\u4f60\u4f1a\u6536\u83b7 &#034;1&#034; &#061;&#061; 1 \u4e3a true\u3001&#034;&#034; &#061;&#061; 0 \u4e3a true \u8fd9\u4e9b\u60ca\u609a\u7ed3\u679c\u2014\u2014\u5b83\u4eec\u662f JS \u9762\u8bd5\u7684\u7ecf\u5178\u9001\u547d\u9898&#xff0c;\u66f4\u662f\u771f\u5b9e\u9879\u76ee\u91cc\u903b\u8f91\u9b3c\u755c\u7684\u5934\u53f7\u6765\u6e90\u3002<\/p>\n<h3>\u4e8c\u3001\u672c\u7bc7\u76ee\u6807<\/h3>\n<li>\u4f1a\u5199 if \/ else if \/ else \u591a\u7ea7\u5206\u652f&#xff1b;<\/li>\n<li>\u7acb &#061;&#061;&#061; \u519b\u89c4&#xff0c;\u8ba4\u6e05 &#061;&#061; \u7684\u9690\u5f0f\u8f6c\u6362\u5751&#xff1b;<\/li>\n<li>\u638c\u63e1 &amp;&amp;\u3001||\u3001! \u4e09\u4e2a\u903b\u8f91\u8fde\u63a5\u8bcd&#xff1b;<\/li>\n<li>\u4f1a\u7528\u4e09\u5143\u8868\u8fbe\u5f0f\u5728\u6a21\u677f\u5b57\u7b26\u4e32\u91cc&#034;\u5c31\u5730\u5206\u5c94&#034;&#xff1b;<\/li>\n<li>\u8ba4\u8bc6 switch&#xff1a;\u540c\u4e00\u4e2a\u53d8\u91cf\u591a\u503c\u5339\u914d\u65f6\u7684\u6e05\u723d\u5199\u6cd5\u3002<\/li>\n<h3>\u4e09\u3001\u77e5\u8bc6\u70b9\u8bb2\u89e3<\/h3>\n<h4>3.1 if \/ else&#xff1a;\u5e03\u5c14\u5f53\u88c1\u5224<\/h4>\n<p><span class=\"token keyword\">const<\/span> score <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">85<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>score <span class=\"token operator\">&gt;&#061;<\/span> <span class=\"token number\">90<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u4f18\u79c0&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>score <span class=\"token operator\">&gt;&#061;<\/span> <span class=\"token number\">60<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u53ca\u683c&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u4e0d\u53ca\u683c&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260916045626-6aaa217a56b17.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u8bed\u6cd5\u8981\u70b9&#xff1a;\u6761\u4ef6\u5199\u5728\u5c0f\u62ec\u53f7\u91cc&#xff0c;\u5927\u62ec\u53f7\u5305\u4f4f&#034;\u6761\u4ef6\u6210\u7acb\u624d\u6267\u884c\u7684\u4ee3\u7801&#034;&#xff1b;else if \u53ef\u4ee5\u8fde\u5f88\u591a\u7ea7&#xff1b;\u4ece\u4e0a\u5f80\u4e0b\u4f9d\u6b21\u68c0\u67e5&#xff0c;\u547d\u4e2d\u4e00\u4e2a\u5c94\u53e3\u5c31\u8fdb&#xff0c;\u540e\u9762\u5168\u90e8\u8df3\u8fc7\u2014\u201485 \u547d\u4e2d &gt;&#061; 60&#xff0c;\u4e0d\u518d\u770b else\u3002<\/p>\n<p>\u6bd4\u8f83\u8fd0\u7b97\u7b26\u5168\u5bb6\u798f&#xff1a;&gt; &gt;&#061; &lt; &lt;&#061; &#061;&#061;&#061;&#xff08;\u76f8\u7b49&#xff09;!&#061;&#061;&#xff08;\u4e0d\u7b49&#xff09;\u3002\u5b83\u4eec\u7684\u4ea7\u51fa\u6c38\u8fdc\u662f\u5e03\u5c14\u503c\u2014\u201403 \u7bc7\u8bf4\u5e03\u5c14\u662f\u5224\u65ad\u71c3\u6599&#xff0c;\u73b0\u5728\u6b63\u5f0f\u70b9\u706b\u3002<\/p>\n<p>falsy \u516d\u5144\u5f1f&#xff1a;\u5c0f\u62ec\u53f7\u91cc\u7684\u6761\u4ef6\u5176\u5b9e\u4e0d\u4e00\u5b9a\u662f\u5e03\u5c14&#xff0c;JS \u4f1a\u81ea\u52a8\u8f6c\u6362\u3002\u53ea\u6709\u516d\u4e2a\u503c\u4f1a\u88ab\u8f6c\u6210 false&#xff1a;false\u30010\u3001&#034;&#034;\u3001null\u3001undefined\u3001NaN&#xff0c;\u5176\u4f59\u4e00\u5207\u8f6c\u6210 true&#xff08;\u8fde &#034;false&#034; \u8fd9\u4e2a\u5b57\u7b26\u4e32\u90fd\u662f true&#xff01;&#xff09;\u3002\u5efa\u8bae&#xff1a;\u6761\u4ef6\u91cc\u6c38\u8fdc\u5199\u660e\u786e\u7684\u6bd4\u8f83&#xff08;\u5982 score &gt;&#061; 60&#xff09;&#xff0c;\u628a\u9690\u5f0f\u8f6c\u6362\u7559\u7ed9\u8bfb\u65e7\u4ee3\u7801\u7684\u65f6\u5019\u3002<\/p>\n<h4>3.2 &#061;&#061;&#061; \u519b\u89c4&#xff1a;\u4e09\u4e2a\u7b49\u53f7\u624d\u662f\u6b63\u9053<\/h4>\n<p>&#061;&#061;&#061; \u5168\u7b49&#xff1a;\u503c\u548c\u7c7b\u578b\u90fd\u76f8\u540c\u624d\u7b97\u76f8\u7b49\u3002&#061;&#061; \u5bbd\u677e&#xff1a;\u5148\u505a\u4e00\u8f6e\u9690\u5f0f\u8f6c\u6362\u518d\u6bd4\u2014\u2014\u8f6c\u6362\u89c4\u5219\u590d\u6742\u5230\u80fd\u51fa\u9762\u8bd5\u9898&#xff1a;<\/p>\n<table>\n<tr>\u8868\u8fbe\u5f0f\u7ed3\u679c\u4eba\u8bdd\u7ffb\u8bd1<\/tr>\n<tbody>\n<tr>\n<td>&#034;1&#034; &#061;&#061; 1<\/td>\n<td>true<\/td>\n<td>\u5b57\u7b26\u4e32\u88ab\u8f6c\u6210\u6570\u5b57\u518d\u6bd4<\/td>\n<\/tr>\n<tr>\n<td>&#034;&#034; &#061;&#061; 0<\/td>\n<td>true<\/td>\n<td>\u7a7a\u4e32\u88ab\u8f6c\u6210 0<\/td>\n<\/tr>\n<tr>\n<td>0 &#061;&#061; false<\/td>\n<td>true<\/td>\n<td>\u6570\u5b57\u88ab\u8f6c\u6210\u5e03\u5c14<\/td>\n<\/tr>\n<tr>\n<td>null &#061;&#061; undefined<\/td>\n<td>true<\/td>\n<td>\u4e24\u4e2a&#034;\u7a7a&#034;\u88ab\u7279\u5224\u76f8\u7b49<\/td>\n<\/tr>\n<tr>\n<td>&#034;1&#034; &#061;&#061;&#061; 1<\/td>\n<td>false<\/td>\n<td>\u7c7b\u578b\u4e0d\u540c&#xff0c;\u76f4\u63a5\u4e0d\u7b49&#xff0c;\u5e72\u51c0\u5229\u843d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u519b\u89c4\u53ea\u6709\u4e00\u53e5&#xff1a;\u81ea\u5df1\u5199\u4ee3\u7801&#xff0c;\u6bd4\u8f83\u76f8\u7b49\u53ea\u7528 &#061;&#061;&#061;&#xff1b;&#061;&#061; \u7559\u7ed9\u8bfb\u522b\u4eba\u7684\u8001\u4ee3\u7801\u65f6&#034;\u8ba4\u8bc6\u5b83&#034;\u3002\u5b83\u548c 04 \u7bc7\u7684\u9690\u5f0f\u8f6c\u6362\u662f\u540c\u4e00\u6b3e\u8d4c\u2014\u2014\u5bbd\u677e\u7b49\u53f7\u8d4c\u7684\u662f&#034;\u8f6c\u6362\u89c4\u5219\u6070\u597d\u5982\u4f60\u6240\u613f&#034;&#xff0c;\u800c\u89c4\u5219\u8868\u957f\u5f97\u6ca1\u4eba\u80cc\u5f97\u5b8c\u3002\u540c\u7406&#xff0c;\u4e0d\u7b49\u7528 !&#061;&#061;&#xff0c;\u522b\u7528 !&#061;\u3002<\/p>\n<h4>3.3 \u903b\u8f91\u8fde\u63a5\u8bcd&#xff1a;&amp;&amp;\u3001||\u3001!<\/h4>\n<p>\u771f\u5b9e\u6761\u4ef6\u5e38\u5e38\u662f\u590d\u5408\u7684\u2014\u2014&#034;90 \u5206\u5e76\u4e14\u5168\u52e4&#034;\u624d\u6709\u5956\u5b66\u91d1&#xff1a;<\/p>\n<p><span class=\"token keyword\">const<\/span> hasScholarship <span class=\"token operator\">&#061;<\/span> score <span class=\"token operator\">&gt;&#061;<\/span> <span class=\"token number\">90<\/span> <span class=\"token operator\">&amp;&amp;<\/span> attendance <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#034;\u5168\u52e4&#034;<\/span><span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">\/\/ \u5e76\u4e14&#xff1a;\u4e24\u8fb9\u90fd\u771f\u624d\u771f<\/span><br \/>\n<span class=\"token keyword\">const<\/span> canMakeup <span class=\"token operator\">&#061;<\/span> score <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">60<\/span> <span class=\"token operator\">||<\/span> score <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token operator\">&#8211;<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span>                  <span class=\"token comment\">\/\/ \u6216\u8005&#xff1a;\u4e00\u8fb9\u771f\u5c31\u771f<\/span><br \/>\n<span class=\"token keyword\">const<\/span> isAbsent <span class=\"token operator\">&#061;<\/span> <span class=\"token operator\">!<\/span><span class=\"token punctuation\">(<\/span>score <span class=\"token operator\">&gt;&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>                                <span class=\"token comment\">\/\/ \u53d6\u53cd&#xff1a;\u771f\u5047\u4e92\u6362<\/span><\/p>\n<p>\u53e3\u8bc0&#xff1a;&amp;&amp; \u6536\u7d27&#xff08;\u90fd\u5f97\u6ee1\u8db3&#xff09;&#xff0c;|| \u653e\u5bbd&#xff08;\u6ee1\u8db3\u5176\u4e00&#xff09;&#xff0c;! \u53cd\u7740\u8bf4\u3002\u590d\u5408\u6761\u4ef6\u5efa\u8bae\u5148\u5b58\u8fdb\u4e00\u4e2a\u89c1\u540d\u77e5\u610f\u7684\u5e03\u5c14\u53d8\u91cf&#xff08;\u5982 hasScholarship&#xff09;&#xff0c;if \u91cc\u53ea\u5199\u53d8\u91cf\u540d\u2014\u2014\u6bd4\u628a\u4e09\u884c\u903b\u8f91\u585e\u8fdb\u5c0f\u62ec\u53f7\u53ef\u8bfb\u5341\u500d\u3002<\/p>\n<p>\u77ed\u8def\u6c42\u503c&#xff08;\u9644\u8d60\u51b7\u77e5\u8bc6&#xff09;&#xff1a;&amp;&amp; \u548c || \u6267\u884c\u65f6\u8fd8\u4f1a&#034;\u5077\u61d2&#034;\u2014\u2014A &amp;&amp; B \u82e5 A \u662f falsy&#xff0c;\u53f3\u8fb9\u770b\u90fd\u4e0d\u770b&#xff0c;\u76f4\u63a5\u8fd4\u56de A&#xff1b;A || B \u82e5 A \u662f truthy&#xff0c;\u540c\u6837\u76f4\u63a5\u8fd4\u56de A\u3002\u8fd9\u4e2a\u7279\u6027\u6700\u51fa\u540d\u7684\u7528\u6cd5\u662f\u515c\u5e95\u9ed8\u8ba4\u503c&#xff1a;<\/p>\n<p><span class=\"token keyword\">const<\/span> input <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;&#034;<\/span><span class=\"token punctuation\">;<\/span>                  <span class=\"token comment\">\/\/ \u7528\u6237\u6ca1\u586b&#xff0c;\u7a7a\u4e32\u662f falsy<\/span><br \/>\n<span class=\"token keyword\">const<\/span> name <span class=\"token operator\">&#061;<\/span> input <span class=\"token operator\">||<\/span> <span class=\"token string\">&#034;\u533f\u540d\u7528\u6237&#034;<\/span><span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">\/\/ \u5de6\u8fb9\u6ca1\u8d27&#xff0c;\u53d6\u53f3\u8fb9\u7684\u515c\u5e95<\/span><br \/>\nconsole<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span>name<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>                 <span class=\"token comment\">\/\/ \u533f\u540d\u7528\u6237<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260916045626-6aaa217a6b80b.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u903b\u8f91&#xff1a;input \u6709\u771f\u5185\u5bb9\u5c31\u7528\u5b83&#xff0c;\u662f\u7a7a\u4e32\/null\/undefined \u8fd9\u7c7b&#034;\u6ca1\u8d27&#034;\u503c\u5c31\u6362\u9ed8\u8ba4\u503c\u300217 \u7bc7\u4ece localStorage \u53d6\u5b58\u6863\u65f6\u4f1a\u7528\u5230\u8fd9\u62db\u2014\u2014\u7b2c\u4e00\u6b21\u8bbf\u95ee\u8fd8\u6ca1\u5b58\u8fc7\u6863&#xff0c;\u53d6\u51fa\u6765\u662f null&#xff0c;\u7528 || \u4e00\u884c\u515c\u5e95&#xff0c;\u4f18\u96c5\u4e0d\u5d29\u3002\u73b0\u5728\u6df7\u4e2a\u8138\u719f&#xff0c;\u5230\u65f6\u5019\u4f1a\u5fc3\u4e00\u7b11\u3002<\/p>\n<h4>3.4 \u4e09\u5143\u8868\u8fbe\u5f0f&#xff1a;\u5c31\u5730\u5206\u5c94\u7684\u5c0f if<\/h4>\n<p>\u6761\u4ef6 ? A : B<\/p>\n<p>\u6761\u4ef6\u771f\u53d6 A\u3001\u5047\u53d6 B\u3002\u5b83\u662f\u8868\u8fbe\u5f0f&#xff08;\u6709\u503c&#xff09;&#xff0c;\u6240\u4ee5\u80fd\u76f4\u63a5\u585e\u8fdb\u6a21\u677f\u5b57\u7b26\u4e32&#xff1a;<\/p>\n<p><span class=\"token keyword\">const<\/span> score <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">85<\/span><span class=\"token punctuation\">;<\/span><br \/>\nconsole<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token template-string\"><span class=\"token template-punctuation string\">&#096;<\/span><span class=\"token string\">\u7ed3\u679c&#xff1a;<\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span>score <span class=\"token operator\">&gt;&#061;<\/span> <span class=\"token number\">60<\/span> <span class=\"token operator\">?<\/span> <span class=\"token string\">&#034;\u901a\u8fc7&#034;<\/span> <span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u8865\u8003&#034;<\/span><span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token template-punctuation string\">&#096;<\/span><\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260916045626-6aaa217a7e693.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u4e00\u53e5\u8bdd\u5b8c\u6210\u5206\u5c94&#xff0c;\u62a5\u8868\u548c\u770b\u677f\u91cc\u9ad8\u9891\u51fa\u573a\u3002\u6ce8\u610f\u5b83\u53ea\u9002\u5408&#034;\u4e8c\u9009\u4e00&#034;\u2014\u2014\u4e09\u5c94\u4ee5\u4e0a\u8001\u5b9e\u7528 if\u3002<\/p>\n<h4>3.5 switch&#xff1a;\u591a\u503c\u5339\u914d\u7684\u6e05\u723d\u5199\u6cd5<\/h4>\n<p>\u540c\u4e00\u4e2a\u53d8\u91cf\u6bd4\u5bf9\u591a\u4e2a\u5177\u4f53\u503c\u65f6&#xff0c;if\/else \u94fe\u5199\u7740\u5570\u55e6&#xff0c;switch \u66f4\u6e05\u723d&#xff1a;<\/p>\n<p><span class=\"token keyword\">const<\/span> level <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;B&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">switch<\/span> <span class=\"token punctuation\">(<\/span>level<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token keyword\">case<\/span> <span class=\"token string\">&#034;A&#034;<\/span><span class=\"token operator\">:<\/span> console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u4f18\u79c0&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">break<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token keyword\">case<\/span> <span class=\"token string\">&#034;B&#034;<\/span><span class=\"token operator\">:<\/span> console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u826f\u597d&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">break<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token keyword\">case<\/span> <span class=\"token string\">&#034;C&#034;<\/span><span class=\"token operator\">:<\/span> console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u53ca\u683c&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">break<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token keyword\">default<\/span><span class=\"token operator\">:<\/span>  console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u5176\u4ed6&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260916045626-6aaa217a90510.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u4e24\u6761\u5fc5\u5b88\u7684\u89c4\u77e9&#xff1a;<\/p>\n<ul>\n<li>\u6bcf\u4e2a case \u672b\u5c3e\u5199 break\u2014\u2014\u6f0f\u4e86 break&#xff0c;\u547d\u4e2d\u540e\u4f1a&#034;\u6f0f&#034;\u5230\u4e0b\u4e00\u4e2a case \u7ee7\u7eed\u6267\u884c&#xff0c;\u7ecf\u5178\u5751&#xff1b;<\/li>\n<li>switch \u7684\u5339\u914d\u7528\u7684\u662f &#061;&#061;&#061;&#xff08;\u4e25\u683c\u76f8\u7b49&#xff09;\u2014\u2014case &#034;A&#034; \u5339\u914d\u4e0d\u4e0a &#034;a&#034;&#xff0c;\u5927\u5c0f\u5199\u654f\u611f\u3002<\/li>\n<\/ul>\n<p>default \u662f\u5168\u90fd\u4e0d\u4e2d\u65f6\u7684\u515c\u5e95&#xff0c;\u76f8\u5f53\u4e8e else\u3002\u6ce8\u610f\u5206\u5de5&#xff1a;\u6bd4\u5bf9\u5177\u4f53\u503c\u7528 switch&#xff0c;\u6bd4\u5bf9\u8303\u56f4&#xff08;\u5206\u6570\u6bb5&#xff09;\u7528 if\u2014\u2014switch \u5199\u4e0d\u4e86 &gt;&#061; 60\u3002<\/p>\n<h3>\u56db\u3001\u5b8c\u6574\u5b9e\u6218&#xff1a;\u6210\u7ee9\u5224\u5b9a\u5668<\/h3>\n<p>\u628a\u4e94\u79cd\u5224\u65ad\u5de5\u5177\u62fc\u6210\u4e00\u53f0\u5b8c\u6574\u7684&#034;\u5224\u5b9a\u673a&#034;\u3002\u65b0\u5efa \u6210\u7ee9\u5224\u5b9a\u5668.html&#xff1a;<\/p>\n<p><span class=\"token doctype\"><span class=\"token punctuation\">&lt;!<\/span><span class=\"token doctype-tag\">DOCTYPE<\/span> <span class=\"token name\">html<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>html<\/span> <span class=\"token attr-name\">lang<\/span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">&#061;<\/span><span class=\"token punctuation\">&#034;<\/span>zh-CN<span class=\"token punctuation\">&#034;<\/span><\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>head<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>meta<\/span> <span class=\"token attr-name\">charset<\/span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">&#061;<\/span><span class=\"token punctuation\">&#034;<\/span>UTF-8<span class=\"token punctuation\">&#034;<\/span><\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>title<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>\u6210\u7ee9\u5224\u5b9a\u5668<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>title<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>head<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>body<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>h2<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>\u6210\u7ee9\u5224\u5b9a\u5668<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>h2<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>p<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>\u5224\u5b9a\u62a5\u544a\u5728\u63a7\u5236\u53f0\u2014\u2014\u6309 F12 \u67e5\u770b\u3002<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>p<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<p>  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>script<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><span class=\"token script\"><span class=\"token language-javascript\"><br \/>\n    <span class=\"token comment\">\/\/ &#061;&#061;&#061;&#061;&#061; \u6570\u636e\u533a &#061;&#061;&#061;&#061;&#061;<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> studentName <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;\u661f\u5b87&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> score <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">78<\/span><span class=\"token punctuation\">;<\/span>             <span class=\"token comment\">\/\/ \u6570\u5b57&#xff0c;\u4e0d\u662f\u5b57\u7b26\u4e32\u2014\u201404 \u7bc7\u7684\u6559\u8bad\u8bb0\u4f4f\u4e86<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> attendance <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;\u5168\u52e4&#034;<\/span><span class=\"token punctuation\">;<\/span>     <span class=\"token comment\">\/\/ \u8003\u52e4\u60c5\u51b5<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ &#061;&#061;&#061;&#061;&#061; \u5224\u5b9a\u533a&#xff1a;\u7b49\u7ea7\u94fe &#061;&#061;&#061;&#061;&#061;<\/span><br \/>\n    <span class=\"token keyword\">let<\/span> grade<span class=\"token punctuation\">;<\/span>                    <span class=\"token comment\">\/\/ \u7b49\u7ea7\u8981\u5148\u7b97\u51fa\u6765&#xff0c;\u6240\u4ee5\u7528 let<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>score <span class=\"token operator\">&gt;&#061;<\/span> <span class=\"token number\">90<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      grade <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;\u4f18\u79c0&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>score <span class=\"token operator\">&gt;&#061;<\/span> <span class=\"token number\">75<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      grade <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;\u826f\u597d&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>score <span class=\"token operator\">&gt;&#061;<\/span> <span class=\"token number\">60<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      grade <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;\u53ca\u683c&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      grade <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;\u4e0d\u53ca\u683c&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ \u590d\u5408\u6761\u4ef6&#xff1a;\u5956\u5b66\u91d1&#xff08;&amp;&amp; \u6536\u7d27&#xff09;<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> hasScholarship <span class=\"token operator\">&#061;<\/span> score <span class=\"token operator\">&gt;&#061;<\/span> <span class=\"token number\">90<\/span> <span class=\"token operator\">&amp;&amp;<\/span> attendance <span class=\"token operator\">&#061;&#061;&#061;<\/span> <span class=\"token string\">&#034;\u5168\u52e4&#034;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ &#061;&#061;&#061;&#061;&#061; \u8f93\u51fa\u533a&#xff1a;\u6a21\u677f\u5b57\u7b26\u4e32 &#043; \u4e09\u5143 &#061;&#061;&#061;&#061;&#061;<\/span><br \/>\n    console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;&#061;&#034;<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">repeat<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">40<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;            \u6210 \u7ee9 \u5224 \u5b9a \u62a5 \u544a&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;&#061;&#034;<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">repeat<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">40<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token template-string\"><span class=\"token template-punctuation string\">&#096;<\/span><span class=\"token string\">\u59d3\u540d&#xff1a;<\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span>studentName<span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token template-punctuation string\">&#096;<\/span><\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token template-string\"><span class=\"token template-punctuation string\">&#096;<\/span><span class=\"token string\">\u5206\u6570&#xff1a;<\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span>score<span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token string\">&#xff08;\u7c7b\u578b <\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span><span class=\"token keyword\">typeof<\/span> score<span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token string\">&#xff0c;\u7eaf\u6570\u5b57&#xff09;<\/span><span class=\"token template-punctuation string\">&#096;<\/span><\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token template-string\"><span class=\"token template-punctuation string\">&#096;<\/span><span class=\"token string\">\u8003\u52e4&#xff1a;<\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span>attendance<span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token template-punctuation string\">&#096;<\/span><\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token template-string\"><span class=\"token template-punctuation string\">&#096;<\/span><span class=\"token string\">\u7b49\u7ea7&#xff1a;<\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span>grade<span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token template-punctuation string\">&#096;<\/span><\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token template-string\"><span class=\"token template-punctuation string\">&#096;<\/span><span class=\"token string\">\u7ed3\u8bba&#xff1a;<\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span>score <span class=\"token operator\">&gt;&#061;<\/span> <span class=\"token number\">60<\/span> <span class=\"token operator\">?<\/span> <span class=\"token string\">&#034;\u672c\u5b66\u671f\u5e73\u5b89\u843d\u5730&#034;<\/span> <span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u5047\u671f\u89c4\u5212\u8865\u8003&#034;<\/span><span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token template-punctuation string\">&#096;<\/span><\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token template-string\"><span class=\"token template-punctuation string\">&#096;<\/span><span class=\"token string\">\u5956\u5b66\u91d1&#xff1a;<\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span>hasScholarship <span class=\"token operator\">?<\/span> <span class=\"token string\">&#034;\u7b26\u5408\u6761\u4ef6&#xff0c;\u53ef\u4ee5\u7533\u8bf7&#034;<\/span> <span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;\u6682\u4e0d\u7b26\u5408&#xff08;\u9700 90 \u5206\u4ee5\u4e0a\u4e14\u5168\u52e4&#xff09;&#034;<\/span><span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token template-punctuation string\">&#096;<\/span><\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;&#061;&#034;<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">repeat<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">40<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <\/span><\/span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>script<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>body<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>html<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<p>\u7559\u4e2a\u5fc3\u773c\u770b\u7ed3\u6784&#xff1a;\u6570\u636e\u533a \u2192 \u5224\u5b9a\u533a \u2192 \u8f93\u51fa\u533a&#xff0c;\u4e09\u6bb5\u5f0f\u548c 03 \u7bc7\u7684\u8d44\u6599\u5361\u4e00\u8109\u76f8\u627f\u2014\u2014\u4ee5\u540e\u6240\u6709\u5de5\u5177\u90fd\u662f&#034;\u6570\u636e\u8fdb\u6765\u3001\u903b\u8f91\u52a0\u5de5\u3001\u62a5\u544a\u51fa\u53bb&#034;&#xff0c;\u53ea\u662f\u6bcf\u6bb5\u4f1a\u8d8a\u957f\u8d8a\u58ee\u3002<\/p>\n<h3>\u4e94\u3001\u8fd0\u884c\u6548\u679c<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260916045626-6aaa217a44b23.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\n            \u6210 \u7ee9 \u5224 \u5b9a \u62a5 \u544a<br \/>\n&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\n\u59d3\u540d&#xff1a;\u661f\u5b87<br \/>\n\u5206\u6570&#xff1a;78&#xff08;\u7c7b\u578b number&#xff0c;\u7eaf\u6570\u5b57&#xff09;<br \/>\n\u8003\u52e4&#xff1a;\u5168\u52e4<br \/>\n\u7b49\u7ea7&#xff1a;\u826f\u597d<br \/>\n\u7ed3\u8bba&#xff1a;\u672c\u5b66\u671f\u5e73\u5b89\u843d\u5730<br \/>\n\u5956\u5b66\u91d1&#xff1a;\u6682\u4e0d\u7b26\u5408&#xff08;\u9700 90 \u5206\u4ee5\u4e0a\u4e14\u5168\u52e4&#xff09;<br \/>\n&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/p>\n<h3>\u516d\u3001\u5e38\u89c1\u62a5\u9519\u4e0e\u6392\u67e5<\/h3>\n<p>\u62a5\u9519 1&#xff1a;SyntaxError: Unexpected token &#039;else&#039; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260916045626-6aaa217aa4278.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u539f\u56e0&#xff1a;\u4e5d\u6210\u662f if \u90a3\u884c\u884c\u5c3e\u624b\u6ed1\u591a\u4e86\u5206\u53f7\u2014\u2014if (score &gt;&#061; 90); \u5206\u53f7\u628a if \u63d0\u524d&#034;\u7ec8\u7ed3&#034;&#xff0c;\u540e\u9762\u7684 else \u6210\u4e86\u5b64\u513f\u3002 \u89e3\u51b3&#xff1a;\u5220\u6389\u90a3\u4e2a\u5206\u53f7\u3002\u519b\u89c4&#xff1a;if \/ else \u884c\u5c3e\u6c38\u8fdc\u4e0d\u5199\u5206\u53f7&#xff08;\u5206\u53f7\u5c5e\u4e8e\u5927\u62ec\u53f7\u91cc\u7684\u8bed\u53e5&#xff0c;\u4e0d\u5c5e\u4e8e if \u884c\u672c\u8eab&#xff09;\u3002<\/p>\n<p>\u73b0\u8c61 2&#xff1a;\u67d0\u4e2a\u5206\u652f\u6c38\u8fdc\u6267\u884c&#xff08;\u6216\u6c38\u8fdc\u4e0d\u6267\u884c&#xff09;<\/p>\n<p>\u539f\u56e0&#xff1a;\u6761\u4ef6\u91cc\u5199\u4e86\u4e00\u4e2a\u7b49\u53f7\u2014\u2014if (score &#061; 90) \u662f\u8d4b\u503c&#xff1a;\u628a 90 \u585e\u8fdb score&#xff0c;\u6574\u4e2a\u8868\u8fbe\u5f0f\u503c\u4e3a 90&#xff08;truthy&#xff09;&#xff0c;\u6c38\u8fdc\u8d70 if \u5206\u652f&#xff0c;\u8fd8\u4e0d\u62a5\u4efb\u4f55\u9519\u3002 \u89e3\u51b3&#xff1a;\u6570\u4e00\u6570\u6761\u4ef6\u91cc\u7684\u7b49\u53f7\u6570\u91cf\u2014\u2014\u4e00\u4e2a &#061; \u662f\u8d4b\u503c&#xff0c;&#061;&#061;&#061; \u624d\u662f\u6bd4\u8f83\u3002\u8fd9\u662f\u65b0\u624b\u903b\u8f91\u9b3c\u755c\u7b2c\u4e00\u540d&#xff0c;\u6bd4\u62a5\u9519\u66f4\u9634\u9669\u3002<\/p>\n<p>\u73b0\u8c61 3&#xff1a;&#034;10&#034; &lt; &#034;9&#034; \u4e3a true<\/p>\n<p>04 \u7bc7\u75ab\u82d7\u7684\u6b63\u5f0f\u7b54\u6848&#xff1a;\u4e24\u8fb9\u90fd\u662f\u5b57\u7b26\u4e32&#xff0c;\u6bd4\u8f83\u8d70\u5b57\u5178\u5e8f&#xff0c;\u9010\u5b57\u7b26\u6bd4\u5bf9\u3002 \u89e3\u51b3&#xff1a;\u6570\u5b57\u6bd4\u8f83\u524d\u5148 Number() \u6d17\u4e00\u904d&#xff0c;\u4fdd\u8bc1\u4e24\u8fb9\u90fd\u662f number\u3002<\/p>\n<p>\u6392\u67e5\u5fc3\u6cd5&#xff1a;else \u62a5\u9519\u627e\u5206\u53f7&#xff0c;\u903b\u8f91\u9b3c\u755c\u6570\u7b49\u53f7&#xff0c;\u6bd4\u8f83\u79bb\u8c31\u67e5\u7c7b\u578b\u3002\u6761\u4ef6\u4e16\u754c\u7684\u4e09\u5927\u5751&#xff0c;\u4e00\u53e5\u8bdd\u6253\u5305\u3002<\/p>\n<h3>\u4e03\u3001\u7ec3\u4e60\u4f5c\u4e1a<\/h3>\n<li>\u624b\u52a8\u6a21\u62df&#xff08;\u5148\u5199\u7b54\u6848\u518d\u56de\u8f66&#xff09;&#xff1a;&#034;1&#034; &#061;&#061; 1\u3001&#034;1&#034; &#061;&#061;&#061; 1\u3001null &#061;&#061; undefined\u3001null &#061;&#061;&#061; undefined\u30010 &#061;&#061; false\u30010 &#061;&#061;&#061; false \u5404\u5f97\u4ec0\u4e48&#xff1f;<\/li>\n<li>\u9884\u6d4b\u518d\u9a8c\u8bc1&#xff1a;const x &#061; 0; \u4e4b\u540e\u6267\u884c if (x &#061; 5) { console.log(&#034;A&#034;); } else { console.log(&#034;B&#034;); } \u8f93\u51fa\u4ec0\u4e48&#xff1f;x \u6700\u540e\u7684\u503c\u53d8\u6210\u4e86\u591a\u5c11&#xff1f;\u4e3a\u4ec0\u4e48&#xff1f;<\/li>\n<li>\u6539\u9020\u8981\u70b9&#xff1a;\u7ed9\u5224\u5b9a\u5668\u52a0&#034;\u65f7\u8003&#034;\u5206\u652f\u2014\u2014score &#061;&#061;&#061; -1 \u8868\u793a\u65f7\u8003&#xff0c;\u7b49\u7ea7\u5224\u4e3a&#034;\u65f7\u8003&#034;\u3001\u7ed3\u8bba\u5224\u4e3a&#034;\u9700\u8054\u7cfb\u6559\u52a1&#034;&#xff1b;\u6ce8\u610f else if \u7684\u987a\u5e8f\u8be5\u63d2\u5728\u54ea&#xff08;\u63d0\u793a&#xff1a;-1 &lt; 60&#xff0c;\u653e\u6700\u524d\u9762\u5224\u65ad&#xff09;&#xff1b;<\/li>\n<li>\u75ab\u82d7&#xff08;\u4e0b\u7bc7\u9884\u544a&#xff09;&#xff1a;\u73b0\u5728\u5224\u5b9a\u5668\u53ea\u80fd\u5224\u4e00\u4e2a\u5b66\u751f\u3002\u5168\u73ed 8 \u4e2a\u4eba\u30018 \u4e2a\u5206\u6570&#xff0c;\u96be\u9053\u628a\u5224\u5b9a\u533a\u590d\u5236 8 \u904d&#xff1f;\u7535\u8111\u6700\u64c5\u957f\u7684\u4e8b\u5c31\u662f\u91cd\u590d\u2014\u201406 \u7bc7\u7684\u5faa\u73af\u4e09\u884c\u4ee3\u7801\u5224 800 \u4eba\u3002\u52a8\u624b\u524d\u5148\u5728\u7eb8\u4e0a\u60f3&#xff1a;\u5224\u5b9a\u533a\u54ea\u4e9b\u884c\u662f&#034;\u6bcf\u4e2a\u5b66\u751f\u90fd\u8981\u8dd1\u4e00\u904d&#034;\u7684&#xff0c;\u54ea\u4e9b\u884c\u662f&#034;\u5168\u73ed\u53ea\u9700\u8dd1\u4e00\u904d&#034;\u7684&#xff1f;&#xff08;\u8fd9\u4e2a\u601d\u8003\u5c31\u662f 07 \u7bc7\u51fd\u6570\u5316\u7684\u9884\u70ed\u3002&#xff09;<\/li>\n<hr \/>\n<p>\u4e0b\u4e00\u7bc7\u9884\u544a&#xff1a;\u300a06 \u5faa\u73af&#xff1a;\u8ba9\u7a0b\u5e8f\u91cd\u590d\u5e72\u6d3b\u300b\u2014\u2014for \u5faa\u73af\u4e09\u6bb5\u5f0f\u300102 \u7bc7\u624b\u5199\u7684\u661f\u661f\u6811\u4e09\u884c\u4ee3\u7801\u751f\u6210\u4e00\u767e\u5c42&#xff0c;\u8fd8\u6709 break\/continue \u4e24\u5f20&#034;\u9003\u751f\u5238&#034;\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u4e00\u7bc7&#xff1a;04 \u6570\u5b57\u4e0e\u5b57\u7b26\u4e32&#xff1a; \u53f7\u7684\u4e24\u526f\u9762\u5b54&#xff08;\u62fc\u63a5\u4e0e\u76f8\u52a0 \u00b7 NaN \u00b7 \u7c7b\u578b\u4e92\u8f6c \u00b7 \u6a21\u677f\u5b57\u7b26\u4e32&#xff09; \u4e0a\u7bc7\u7ec3\u4e60\u53c2\u8003\u7b54\u6848<br \/>\n\u7ec3\u4e60 1&#xff08;\u624b\u52a8\u6a21\u62df&#xff09;&#xff1a;\u624b\u52a8\u6a21\u62df&#xff08;\u5148\u5199\u7b54\u6848\u518d\u56de\u8f66&#xff09;&#xff1a;\u201c10\u201d  5\u300110  5  \u201c5\u201d\u3001\u201c10\u201d &#8211; 5\u3001\u201c3\u201d * \u201c4\u201d \u5404\u5f97\u4ec0\u4e48&#xff1f;<br \/>\n\u89c4\u5f8b\u6536\u53e3&#xff1a;\u53ea\u6709  \u9047\u6587\u5219\u6587&#xff0c;\u5176\u4ed6\u8fd0\u7b97<\/p>\n","protected":false},"author":2,"featured_media":105941,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11815,187,76,87,190],"topic":[],"class_list":["post-105949","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-11815","tag-javascript","tag-vscode","tag-87","tag-190"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>05 \u6761\u4ef6\u5224\u65ad\uff1a=== \u624d\u662f\u6b63\u9053\uff08if\/else \u00b7 \u903b\u8f91\u8fde\u63a5\u8bcd \u00b7 \u4e09\u5143 \u00b7 switch\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/105949.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"05 \u6761\u4ef6\u5224\u65ad\uff1a=== \u624d\u662f\u6b63\u9053\uff08if\/else \u00b7 \u903b\u8f91\u8fde\u63a5\u8bcd \u00b7 \u4e09\u5143 \u00b7 switch\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e0a\u4e00\u7bc7&#xff1a;04 \u6570\u5b57\u4e0e\u5b57\u7b26\u4e32&#xff1a; \u53f7\u7684\u4e24\u526f\u9762\u5b54&#xff08;\u62fc\u63a5\u4e0e\u76f8\u52a0 \u00b7 NaN \u00b7 \u7c7b\u578b\u4e92\u8f6c \u00b7 \u6a21\u677f\u5b57\u7b26\u4e32&#xff09; \u4e0a\u7bc7\u7ec3\u4e60\u53c2\u8003\u7b54\u6848 \u7ec3\u4e60 1&#xff08;\u624b\u52a8\u6a21\u62df&#xff09;&#xff1a;\u624b\u52a8\u6a21\u62df&#xff08;\u5148\u5199\u7b54\u6848\u518d\u56de\u8f66&#xff09;&#xff1a;\u201c10\u201d 5\u300110 5 \u201c5\u201d\u3001\u201c10\u201d - 5\u3001\u201c3\u201d * \u201c4\u201d \u5404\u5f97\u4ec0\u4e48&#xff1f;  \u89c4\u5f8b\u6536\u53e3&#xff1a;\u53ea\u6709 \u9047\u6587\u5219\u6587&#xff0c;\u5176\u4ed6\u8fd0\u7b97\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/105949.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-16T04:56:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260916045625-6aaa2179ba81a.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/105949.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/105949.html\",\"name\":\"05 \u6761\u4ef6\u5224\u65ad\uff1a=== \u624d\u662f\u6b63\u9053\uff08if\/else \u00b7 \u903b\u8f91\u8fde\u63a5\u8bcd \u00b7 \u4e09\u5143 \u00b7 switch\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-16T04:56:27+00:00\",\"dateModified\":\"2026-09-16T04:56:27+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/105949.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/105949.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/105949.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"05 \u6761\u4ef6\u5224\u65ad\uff1a=== \u624d\u662f\u6b63\u9053\uff08if\/else \u00b7 \u903b\u8f91\u8fde\u63a5\u8bcd \u00b7 \u4e09\u5143 \u00b7 switch\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"05 \u6761\u4ef6\u5224\u65ad\uff1a=== \u624d\u662f\u6b63\u9053\uff08if\/else \u00b7 \u903b\u8f91\u8fde\u63a5\u8bcd \u00b7 \u4e09\u5143 \u00b7 switch\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/105949.html","og_locale":"zh_CN","og_type":"article","og_title":"05 \u6761\u4ef6\u5224\u65ad\uff1a=== \u624d\u662f\u6b63\u9053\uff08if\/else \u00b7 \u903b\u8f91\u8fde\u63a5\u8bcd \u00b7 \u4e09\u5143 \u00b7 switch\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e0a\u4e00\u7bc7&#xff1a;04 \u6570\u5b57\u4e0e\u5b57\u7b26\u4e32&#xff1a; \u53f7\u7684\u4e24\u526f\u9762\u5b54&#xff08;\u62fc\u63a5\u4e0e\u76f8\u52a0 \u00b7 NaN \u00b7 \u7c7b\u578b\u4e92\u8f6c \u00b7 \u6a21\u677f\u5b57\u7b26\u4e32&#xff09; \u4e0a\u7bc7\u7ec3\u4e60\u53c2\u8003\u7b54\u6848 \u7ec3\u4e60 1&#xff08;\u624b\u52a8\u6a21\u62df&#xff09;&#xff1a;\u624b\u52a8\u6a21\u62df&#xff08;\u5148\u5199\u7b54\u6848\u518d\u56de\u8f66&#xff09;&#xff1a;\u201c10\u201d 5\u300110 5 \u201c5\u201d\u3001\u201c10\u201d - 5\u3001\u201c3\u201d * \u201c4\u201d \u5404\u5f97\u4ec0\u4e48&#xff1f;  \u89c4\u5f8b\u6536\u53e3&#xff1a;\u53ea\u6709 \u9047\u6587\u5219\u6587&#xff0c;\u5176\u4ed6\u8fd0\u7b97","og_url":"https:\/\/www.wsisp.com\/helps\/105949.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-16T04:56:27+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260916045625-6aaa2179ba81a.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/105949.html","url":"https:\/\/www.wsisp.com\/helps\/105949.html","name":"05 \u6761\u4ef6\u5224\u65ad\uff1a=== \u624d\u662f\u6b63\u9053\uff08if\/else \u00b7 \u903b\u8f91\u8fde\u63a5\u8bcd \u00b7 \u4e09\u5143 \u00b7 switch\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-16T04:56:27+00:00","dateModified":"2026-09-16T04:56:27+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/105949.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/105949.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/105949.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"05 \u6761\u4ef6\u5224\u65ad\uff1a=== \u624d\u662f\u6b63\u9053\uff08if\/else \u00b7 \u903b\u8f91\u8fde\u63a5\u8bcd \u00b7 \u4e09\u5143 \u00b7 switch\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/105949","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=105949"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/105949\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/105941"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=105949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=105949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=105949"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=105949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}