{"id":83385,"date":"2026-07-25T21:33:20","date_gmt":"2026-07-25T13:33:20","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/83385.html"},"modified":"2026-07-25T21:33:20","modified_gmt":"2026-07-25T13:33:20","slug":"js%e6%95%b0%e7%bb%84%e5%ae%8c%e5%85%a8%e6%8c%87%e5%8d%97%ef%bc%88%e5%90%ab%e5%8d%81%e5%a4%a7%e6%93%8d%e4%bd%9c%e8%af%a6%e8%a7%a3%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/83385.html","title":{"rendered":"JS\u6570\u7ec4\u5b8c\u5168\u6307\u5357\uff08\u542b\u5341\u5927\u64cd\u4f5c\u8be6\u89e3\uff09"},"content":{"rendered":"<h3>\u524d\u8a00<\/h3>\n<p>\u6570\u7ec4\u662fJavaScript\u4e2d\u6700\u5e38\u7528\u7684\u6570\u636e\u7ed3\u6784\u4e4b\u4e00\u3002\u672c\u6587\u5c06\u7cfb\u7edf\u8bb2\u89e3\u6570\u7ec4\u7684\u6982\u5ff5\u3001\u521b\u5efa\u65b9\u5f0f\u3001\u57fa\u672c\u64cd\u4f5c\u3001\u904d\u5386\u65b9\u6cd5\u3001\u6392\u5e8f\u7b97\u6cd5\u3001\u589e\u5220\u6539\u67e5\u4ee5\u53ca\u9ad8\u7ea7\u65b9\u6cd5&#xff0c;\u6db5\u76d6\u6570\u7ec4\u76f8\u5173\u7684\u6240\u6709\u6838\u5fc3\u77e5\u8bc6\u70b9\u3002\u65e0\u8bba\u4f60\u662f\u521d\u5b66\u8005\u8fd8\u662f\u6709\u4e00\u5b9a\u7ecf\u9a8c\u7684\u5f00\u53d1\u8005&#xff0c;\u90fd\u80fd\u4ece\u4e2d\u83b7\u5f97\u6536\u83b7\u3002<\/p>\n<hr \/>\n<h3>\u4e00\u3001\u6570\u7ec4\u7684\u6982\u5ff5<\/h3>\n<p>\u6570\u7ec4\u662f\u6307\u4e00\u7ec4\u6709\u5e8f\u6570\u636e\u7684\u96c6\u5408&#xff0c;\u5176\u4e2d\u6bcf\u4e2a\u6570\u636e\u88ab\u79f0\u4e3a\u5143\u7d20\u3002\u6570\u7ec4\u4e2d\u53ef\u4ee5\u5b58\u653e\u4efb\u610f\u7c7b\u578b\u7684\u5143\u7d20&#xff0c;\u5b83\u662f\u5c06\u4e00\u7ec4\u6570\u636e\u5b58\u50a8\u5728\u5355\u4e2a\u53d8\u91cf\u540d\u4e0b\u7684\u4f18\u96c5\u65b9\u5f0f\u3002<\/p>\n<h4>1.1 \u6570\u7ec4\u4e0e\u666e\u901a\u5bf9\u8c61\u7684\u533a\u522b<\/h4>\n<table>\n<tr>\n<p>\u5bf9\u6bd4\u9879<\/p>\n<p>\u666e\u901a\u5bf9\u8c61<\/p>\n<p>\u6570\u7ec4<\/p>\n<\/tr>\n<tbody>\n<tr>\n<td>\n<p>\u5c5e\u6027\u540d\u200b<\/p>\n<\/td>\n<td>\n<p>\u5b57\u7b26\u4e32<\/p>\n<\/td>\n<td>\n<p>\u6570\u5b57\u7d22\u5f15&#xff08;\u4ece0\u5f00\u59cb&#xff09;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u5b58\u50a8\u6027\u80fd\u200b<\/p>\n<\/td>\n<td>\n<p>\u4e00\u822c<\/p>\n<\/td>\n<td>\n<p>\u8f83\u597d<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u9002\u7528\u573a\u666f\u200b<\/p>\n<\/td>\n<td>\n<p>\u63cf\u8ff0\u4e8b\u7269\u7279\u5f81<\/p>\n<\/td>\n<td>\n<p>\u5b58\u50a8\u6709\u5e8f\u6570\u636e\u96c6\u5408<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6570\u7ec4\u662f\u4e00\u4e2a\u7279\u6b8a\u7684\u5bf9\u8c61&#xff0c;\u5b83\u4f7f\u7528\u6570\u5b57\u4f5c\u4e3a\u7d22\u5f15\u6765\u64cd\u4f5c\u5143\u7d20\u3002\u7d22\u5f15\u662f\u4ece0\u5f00\u59cb\u7684\u6574\u6570\u3002<\/p>\n<p>let arr &#061; [&#039;\u5b59\u609f\u7a7a&#039;, &#039;\u732a\u516b\u6212&#039;, &#039;\u6c99\u548c\u5c1a&#039;];<br \/>\nconsole.log(arr[0]); \/\/ \u5b59\u609f\u7a7a<br \/>\nconsole.log(arr[1]); \/\/ \u732a\u516b\u6212<\/p>\n<hr \/>\n<h3>\u4e8c\u3001\u6570\u7ec4\u7684\u521b\u5efa\u65b9\u5f0f<\/h3>\n<h4>2.1 \u5b57\u9762\u91cf\u521b\u5efa&#xff08;\u63a8\u8350&#xff09;<\/h4>\n<p>let arr1 &#061; [1, 2, 3]; \/\/ \u5e95\u5c42\u81ea\u52a8\u8c03\u7528 new Array()<\/p>\n<h4>2.2 \u6784\u9020\u51fd\u6570\u521b\u5efa<\/h4>\n<p>\/\/ \u7a7a\u6570\u7ec4<br \/>\nlet arr2 &#061; new Array();<\/p>\n<p>\/\/ \u76f4\u63a5\u586b\u5145\u5185\u5bb9<br \/>\nlet arr3 &#061; new Array(&#034;hello&#034;, &#034;\u4f60\u597d&#034;, 8);<\/p>\n<p>\/\/ \u8bbe\u7f6e\u521d\u59cb\u957f\u5ea6&#xff08;\u5355\u4e2a\u6570\u5b57\u53c2\u6570&#xff09;<br \/>\nlet arr4 &#061; new Array(5); \/\/ \u521b\u5efa\u957f\u5ea6\u4e3a5\u7684\u7a7a\u6570\u7ec4<\/p>\n<p>\u6ce8\u610f&#xff1a;\u5982\u679c\u6784\u9020\u51fd\u6570\u53ea\u63a5\u6536\u4e00\u4e2a\u6570\u5b57\u53c2\u6570&#xff0c;\u8be5\u6570\u5b57\u8868\u793a\u6570\u7ec4\u957f\u5ea6&#xff1b;\u5176\u4ed6\u60c5\u51b5\u90fd\u4f1a\u6210\u4e3a\u6570\u7ec4\u5143\u7d20\u3002<\/p>\n<hr \/>\n<h3>\u4e09\u3001\u6570\u7ec4\u7684\u57fa\u672c\u64cd\u4f5c<\/h3>\n<h4>3.1 \u8bfb\u53d6\u6570\u7ec4\u5143\u7d20<\/h4>\n<p>\u901a\u8fc7\u6570\u7ec4\u540d[\u7d22\u5f15]\u7684\u5f62\u5f0f\u83b7\u53d6\u5143\u7d20\u3002\u5982\u679c\u8bfb\u53d6\u4e0d\u5b58\u5728\u7684\u7d22\u5f15&#xff0c;\u4e0d\u4f1a\u62a5\u9519&#xff0c;\u800c\u662f\u8fd4\u56deundefined\u3002<\/p>\n<p>let arr &#061; [&#034;\u5b59\u609f\u7a7a&#034;, &#034;\u732a\u516b\u6212&#034;, &#034;\u6c99\u548c\u5c1a&#034;, &#034;\u5510\u50e7&#034;];<br \/>\nconsole.log(arr[1]); \/\/ &#034;\u732a\u516b\u6212&#034;&#xff08;\u7d22\u5f15\u4ece0\u5f00\u59cb&#xff09;<br \/>\nconsole.log(arr[10]); \/\/ undefined<\/p>\n<h4>3.2 \u6dfb\u52a0\/\u4fee\u6539\u5143\u7d20<\/h4>\n<p>arr[4] &#061; &#034;\u767d\u9aa8\u7cbe&#034;; \/\/ \u65b0\u589e\u5143\u7d20<br \/>\narr[0] &#061; &#034;\u7389\u7687\u5927\u5e1d&#034;; \/\/ \u4fee\u6539\u5143\u7d20<\/p>\n<h4>3.3 \u83b7\u53d6\u6570\u7ec4\u957f\u5ea6<\/h4>\n<p>\u4f7f\u7528length\u5c5e\u6027\u83b7\u53d6\u6570\u7ec4\u957f\u5ea6&#xff08;\u5143\u7d20\u4e2a\u6570&#xff09;\u3002<\/p>\n<p>console.log(arr.length); \/\/ \u83b7\u53d6\u6570\u7ec4\u957f\u5ea6<\/p>\n<p>\u6ce8\u610f&#xff1a;\u5bf9\u4e8e\u975e\u8fde\u7eed\u7684\u6570\u7ec4&#xff0c;length\u4f1a\u83b7\u53d6\u5230\u6570\u7ec4\u7684\u6700\u5927\u7d22\u5f15&#043;1\u3002\u5efa\u8bae\u5c3d\u91cf\u4e0d\u8981\u521b\u5efa\u975e\u8fde\u7eed\u7684\u6570\u7ec4\u3002<\/p>\n<h4>3.4 \u4fee\u6539length\u5c5e\u6027<\/h4>\n<p>arr.length &#061; 10; \/\/ \u5927\u4e8e\u539f\u957f\u5ea6&#xff0c;\u591a\u51fa\u90e8\u5206\u7a7a\u51fa\u6765<br \/>\narr.length &#061; 3;  \/\/ \u5c0f\u4e8e\u539f\u957f\u5ea6&#xff0c;\u591a\u51fa\u7684\u5143\u7d20\u88ab\u5220\u9664<\/p>\n<h4>3.5 \u5411\u672b\u5c3e\u6dfb\u52a0\u5143\u7d20<\/h4>\n<p>arr[arr.length] &#061; &#034;\u738b\u6bcd&#034;; \/\/ \u52a8\u6001\u6dfb\u52a0<\/p>\n<hr \/>\n<h3>\u56db\u3001\u6570\u7ec4\u5143\u7d20\u7684\u6570\u636e\u7c7b\u578b<\/h3>\n<p>\u6570\u7ec4\u5143\u7d20\u53ef\u4ee5\u662f\u4efb\u610f\u6570\u636e\u7c7b\u578b&#xff1a;\u5b57\u7b26\u4e32\u3001\u6570\u5b57\u3001\u5bf9\u8c61\u3001\u6570\u7ec4\u3001\u51fd\u6570\u7b49\u3002<\/p>\n<p>let arr &#061; [<br \/>\n    1,                                    \/\/ \u6570\u5b57<br \/>\n    &#034;hello&#034;,                              \/\/ \u5b57\u7b26\u4e32<br \/>\n    true,                                 \/\/ \u5e03\u5c14\u503c<br \/>\n    { name: &#034;jack&#034; },                     \/\/ \u5bf9\u8c61<br \/>\n    function() { console.log(&#034;hi&#034;); },    \/\/ \u51fd\u6570<br \/>\n    [2, [66, 88, { age: 18 }], 4]         \/\/ \u4e8c\u7ef4\u6570\u7ec4<br \/>\n];<\/p>\n<p>\/\/ \u8bbf\u95ee\u65b9\u5f0f<br \/>\nconsole.log(arr[3].name);  \/\/ &#034;jack&#034;<br \/>\narr[4]();                  \/\/ \u8c03\u7528\u51fd\u6570&#xff0c;\u8f93\u51fa&#034;hi&#034;<br \/>\nconsole.log(arr[5][2]);    \/\/ 4<\/p>\n<hr \/>\n<h3>\u4e94\u3001\u68c0\u6d4b\u6570\u7ec4\u7684\u65b9\u6cd5<\/h3>\n<table>\n<tr>\n<p>\u65b9\u6cd5<\/p>\n<p>\u8bed\u6cd5<\/p>\n<p>\u4f18\u7f3a\u70b9<\/p>\n<\/tr>\n<tbody>\n<tr>\n<td>\n<p>instanceof\u200b<\/p>\n<\/td>\n<td>\n<p>arr instanceof Array<\/p>\n<\/td>\n<td>\n<p>\u8de8iframe\u65f6\u53ef\u80fd\u5931\u6548<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Array.isArray()\u200b<\/p>\n<\/td>\n<td>\n<p>Array.isArray(value)<\/p>\n<\/td>\n<td>\n<p>\u63a8\u8350\u4f7f\u7528&#xff0c;\u6700\u7b80\u6d01\u53ef\u9760<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Object.prototype.toString\u200b<\/p>\n<\/td>\n<td>\n<p>Object.prototype.toString.call(arr)<\/p>\n<\/td>\n<td>\n<p>\u517c\u5bb9\u6027\u6781\u4f73<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>constructor\u200b<\/p>\n<\/td>\n<td>\n<p>arr.constructor &#061;&#061;&#061; Array<\/p>\n<\/td>\n<td>\n<p>constructor\u53ef\u88ab\u4fee\u6539<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>let arr &#061; [1, 2, 3];<\/p>\n<p>console.log(arr instanceof Array);               \/\/ true<br \/>\nconsole.log(Array.isArray(arr));                 \/\/ true&#xff08;\u63a8\u8350&#xff09;<br \/>\nconsole.log(Object.prototype.toString.call(arr)); \/\/ &#034;[object Array]&#034;<br \/>\nconsole.log(arr.constructor &#061;&#061;&#061; Array);          \/\/ true<\/p>\n<p>\u5b9e\u9645\u5f00\u53d1\u63a8\u8350&#xff1a;\u4f18\u5148\u4f7f\u7528Array.isArray()\u3002<\/p>\n<hr \/>\n<h3>\u516d\u3001\u6570\u7ec4\u904d\u5386\u65b9\u6cd5<\/h3>\n<h4>6.1 \u57fa\u672cfor\u5faa\u73af<\/h4>\n<p>let arr &#061; [&#034;red&#034;, &#034;orange&#034;, &#034;yellow&#034;, &#034;green&#034;];<br \/>\nfor (let i &#061; 0; i &lt; arr.length; i&#043;&#043;) {<br \/>\n    console.log(arr[i]);<br \/>\n}<\/p>\n<h4>6.2 \u4f18\u5316\u7248for\u5faa\u73af&#xff08;\u7f13\u5b58\u957f\u5ea6&#xff09;<\/h4>\n<p>for (let i &#061; 0, len &#061; arr.length; i &lt; len; i&#043;&#043;) {<br \/>\n    console.log(arr[i]);<br \/>\n}<\/p>\n<h4>6.3 for&#8230;in\u5faa\u73af<\/h4>\n<p>for (let i in arr) {<br \/>\n    console.log(arr[i]);<br \/>\n}<\/p>\n<h4>6.4 for&#8230;of\u5faa\u73af&#xff08;ES6&#xff09;<\/h4>\n<p>for (let v of arr) {<br \/>\n    console.log(v); \/\/ \u76f4\u63a5\u83b7\u53d6\u5143\u7d20\u503c<br \/>\n}<br \/>\n\/\/ \u6ce8\u610f&#xff1a;\u666e\u901a\u5bf9\u8c61\u4e0d\u80fd\u4f7f\u7528 for&#8230;of<\/p>\n<h4>6.5 forEach()\u65b9\u6cd5<\/h4>\n<p>arr.forEach(function(item, index, arr) {<br \/>\n    console.log(item);  \/\/ \u5f53\u524d\u5143\u7d20<br \/>\n    console.log(index); \/\/ \u5f53\u524d\u7d22\u5f15<br \/>\n    console.log(arr);   \/\/ \u6570\u7ec4\u672c\u8eab<br \/>\n});<\/p>\n<p>\u56de\u8c03\u51fd\u6570&#xff1a;\u7531\u6211\u4eec\u521b\u5efa\u4f46\u4e0d\u7531\u6211\u4eec\u8c03\u7528\u7684\u51fd\u6570\u3002\u6570\u7ec4\u4e2d\u6709\u51e0\u4e2a\u5143\u7d20&#xff0c;\u51fd\u6570\u5c31\u6267\u884c\u51e0\u6b21\u3002<\/p>\n<hr \/>\n<h3>\u4e03\u3001\u6570\u7ec4\u6392\u5e8f\u7b97\u6cd5&#xff1a;\u5192\u6ce1\u6392\u5e8f<\/h3>\n<p>\u539f\u7406&#xff1a;\u91cd\u590d\u5730\u8d70\u8bbf\u8fc7\u8981\u6392\u5e8f\u7684\u6570\u5217&#xff0c;\u4e00\u6b21\u6bd4\u8f83\u4e24\u4e2a\u5143\u7d20&#xff0c;\u5982\u679c\u987a\u5e8f\u9519\u8bef\u5c31\u628a\u5b83\u4eec\u4ea4\u6362\u8fc7\u6765\u3002\u8d70\u8bbf\u6570\u5217\u7684\u5de5\u4f5c\u91cd\u590d\u8fdb\u884c&#xff0c;\u76f4\u5230\u6ca1\u6709\u518d\u9700\u8981\u4ea4\u6362\u4e3a\u6b62\u3002<\/p>\n<p>let arr &#061; [1, 3, 6, 4, 5, 2];<\/p>\n<p>for (let i &#061; 0; i &lt; arr.length &#8211; 1; i&#043;&#043;) {<br \/>\n    for (let j &#061; 0; j &lt; arr.length &#8211; 1 &#8211; i; j&#043;&#043;) {<br \/>\n        if (arr[j] &gt; arr[j &#043; 1]) {<br \/>\n            let temp &#061; arr[j];<br \/>\n            arr[j] &#061; arr[j &#043; 1];<br \/>\n            arr[j &#043; 1] &#061; temp;<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>console.log(arr); \/\/ [1, 2, 3, 4, 5, 6]<\/p>\n<hr \/>\n<h3>\u516b\u3001\u6570\u7ec4\u5143\u7d20\u64cd\u4f5c<\/h3>\n<h4>8.1 \u6dfb\u52a0\u5143\u7d20<\/h4>\n<table>\n<tr>\n<p>\u65b9\u6cd5<\/p>\n<p>\u529f\u80fd<\/p>\n<p>\u8fd4\u56de\u503c<\/p>\n<p>\u662f\u5426\u6539\u53d8\u539f\u6570\u7ec4<\/p>\n<\/tr>\n<tbody>\n<tr>\n<td>\n<p>push()<\/p>\n<\/td>\n<td>\n<p>\u5411\u672b\u5c3e\u6dfb\u52a0\u4e00\u4e2a\u6216\u591a\u4e2a\u5143\u7d20<\/p>\n<\/td>\n<td>\n<p>\u65b0\u6570\u7ec4\u957f\u5ea6<\/p>\n<\/td>\n<td>\n<p>\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>unshift()<\/p>\n<\/td>\n<td>\n<p>\u5411\u5f00\u5934\u6dfb\u52a0\u4e00\u4e2a\u6216\u591a\u4e2a\u5143\u7d20<\/p>\n<\/td>\n<td>\n<p>\u65b0\u6570\u7ec4\u957f\u5ea6<\/p>\n<\/td>\n<td>\n<p>\u2705<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>let arr &#061; [&#034;\u5b59\u609f\u7a7a&#034;, &#034;\u6c99\u548c\u5c1a&#034;, &#034;\u732a\u516b\u6212&#034;];<\/p>\n<p>\/\/ push() &#8211; \u5411\u672b\u5c3e\u6dfb\u52a0<br \/>\narr.push(&#034;\u5510\u4e09\u85cf&#034;, &#034;\u7389\u7687\u5927\u5e1d&#034;); \/\/ \u8fd4\u56de\u65b0\u957f\u5ea6<\/p>\n<p>\/\/ unshift() &#8211; \u5411\u5f00\u5934\u6dfb\u52a0<br \/>\narr.unshift(&#034;\u5510\u4e09\u85cf&#034;, &#034;\u7389\u7687\u5927\u5e1d&#034;); \/\/ \u8fd4\u56de\u65b0\u957f\u5ea6<\/p>\n<h4>8.2 \u5220\u9664\u5143\u7d20<\/h4>\n<table>\n<tr>\n<p>\u65b9\u6cd5<\/p>\n<p>\u529f\u80fd<\/p>\n<p>\u8fd4\u56de\u503c<\/p>\n<p>\u662f\u5426\u6539\u53d8\u539f\u6570\u7ec4<\/p>\n<\/tr>\n<tbody>\n<tr>\n<td>\n<p>pop()<\/p>\n<\/td>\n<td>\n<p>\u5220\u9664\u6700\u540e\u4e00\u4e2a\u5143\u7d20<\/p>\n<\/td>\n<td>\n<p>\u88ab\u5220\u9664\u7684\u5143\u7d20<\/p>\n<\/td>\n<td>\n<p>\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>shift()<\/p>\n<\/td>\n<td>\n<p>\u5220\u9664\u7b2c\u4e00\u4e2a\u5143\u7d20<\/p>\n<\/td>\n<td>\n<p>\u88ab\u5220\u9664\u7684\u5143\u7d20<\/p>\n<\/td>\n<td>\n<p>\u2705<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\/\/ pop() &#8211; \u5220\u9664\u6700\u540e\u4e00\u4e2a\u5143\u7d20<br \/>\nlet lastElement &#061; arr.pop();<\/p>\n<p>\/\/ shift() &#8211; \u5220\u9664\u7b2c\u4e00\u4e2a\u5143\u7d20<br \/>\nlet firstElement &#061; arr.shift();<\/p>\n<hr \/>\n<h3>\u4e5d\u3001\u6570\u7ec4\u622a\u53d6\u548c\u5220\u9664<\/h3>\n<h4>9.1 slice() &#8211; \u622a\u53d6\u6570\u7ec4&#xff08;\u4e0d\u6539\u53d8\u539f\u6570\u7ec4&#xff09;<\/h4>\n<p>let arr &#061; [&#034;hello&#034;, true, 1, 2, &#034;\u4f60\u597d&#034;, undefined, null, &#034;\u95ee\u5fc3&#034;];<\/p>\n<p>let newArr &#061; arr.slice(0, 4);   \/\/ \u622a\u53d6\u7d22\u5f150-3<br \/>\nnewArr &#061; arr.slice(0);          \/\/ \u590d\u5236\u6574\u4e2a\u6570\u7ec4<br \/>\nnewArr &#061; arr.slice(0, -1);      \/\/ \u622a\u53d6\u5230\u5012\u6570\u7b2c\u4e8c\u4e2a<\/p>\n<p>\u53c2\u6570\u8bf4\u660e&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7b2c\u4e00\u4e2a\u53c2\u6570&#xff1a;\u5f00\u59cb\u4f4d\u7f6e\u7d22\u5f15&#xff08;\u5305\u542b&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e8c\u4e2a\u53c2\u6570&#xff1a;\u7ed3\u675f\u4f4d\u7f6e\u7d22\u5f15&#xff08;\u4e0d\u5305\u542b&#xff09;&#xff0c;\u53ef\u7701\u7565<\/p>\n<\/li>\n<li>\n<p>\u652f\u6301\u8d1f\u503c\u7d22\u5f15&#xff08;-1\u8868\u793a\u5012\u6570\u7b2c\u4e00\u4e2a&#xff09;<\/p>\n<\/li>\n<\/ul>\n<h4>9.2 splice() &#8211; \u5220\u9664\/\u66ff\u6362\u5143\u7d20&#xff08;\u6539\u53d8\u539f\u6570\u7ec4&#xff09;<\/h4>\n<p>\/\/ \u5220\u9664\u5143\u7d20<br \/>\nlet deleted &#061; arr.splice(0, 1); \/\/ \u4ece\u7d22\u5f150\u5f00\u59cb\u5220\u96641\u4e2a\u5143\u7d20<\/p>\n<p>\/\/ \u66ff\u6362\u5143\u7d20&#xff08;\u5220\u9664\u5e76\u63d2\u5165\u65b0\u5143\u7d20&#xff09;<br \/>\narr.splice(0, 1, &#034;1&#034;, &#034;2&#034;, &#034;3&#034;);<\/p>\n<p>\u53c2\u6570\u8bf4\u660e&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u7b2c\u4e00\u4e2a&#xff1a;\u5f00\u59cb\u4f4d\u7f6e\u7684\u7d22\u5f15<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e8c\u4e2a&#xff1a;\u5220\u9664\u7684\u6570\u91cf<\/p>\n<\/li>\n<li>\n<p>\u7b2c\u4e09\u4e2a\u53ca\u4ee5\u540e&#xff1a;\u63d2\u5165\u7684\u65b0\u5143\u7d20<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h3>\u5341\u3001\u6570\u7ec4\u67e5\u627e\u65b9\u6cd5<\/h3>\n<table>\n<tr>\n<p>\u65b9\u6cd5<\/p>\n<p>\u529f\u80fd<\/p>\n<p>\u8fd4\u56de\u503c<\/p>\n<\/tr>\n<tbody>\n<tr>\n<td>\n<p>indexOf()<\/p>\n<\/td>\n<td>\n<p>\u67e5\u627e\u5143\u7d20\u7b2c\u4e00\u6b21\u51fa\u73b0\u7684\u7d22\u5f15<\/p>\n<\/td>\n<td>\n<p>\u7d22\u5f15\u6216-1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>lastIndexOf()<\/p>\n<\/td>\n<td>\n<p>\u67e5\u627e\u5143\u7d20\u6700\u540e\u4e00\u6b21\u51fa\u73b0\u7684\u7d22\u5f15<\/p>\n<\/td>\n<td>\n<p>\u7d22\u5f15\u6216-1<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>includes()<\/p>\n<\/td>\n<td>\n<p>\u5224\u65ad\u6570\u7ec4\u662f\u5426\u5305\u542b\u6307\u5b9a\u5143\u7d20<\/p>\n<\/td>\n<td>\n<p>true\/false<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>let arr &#061; [&#034;red&#034;, &#034;orange&#034;, &#034;green&#034;, &#034;yellow&#034;, &#034;green&#034;];<\/p>\n<p>let index &#061; arr.indexOf(&#034;green&#034;);      \/\/ 2&#xff08;\u7b2c\u4e00\u4e2a\u5339\u914d\u7684\u7d22\u5f15&#xff09;<br \/>\nlet notFound &#061; arr.indexOf(&#034;purple&#034;);  \/\/ -1&#xff08;\u672a\u627e\u5230&#xff09;<br \/>\nlet lastIndex &#061; arr.lastIndexOf(&#034;green&#034;); \/\/ 4&#xff08;\u6700\u540e\u4e00\u4e2a\u5339\u914d\u7684\u7d22\u5f15&#xff09;<br \/>\nlet exists &#061; arr.includes(&#034;orange&#034;);   \/\/ true<\/p>\n<hr \/>\n<h3>\u5341\u4e00\u3001\u6570\u7ec4\u8f6c\u6362\u548c\u6392\u5e8f<\/h3>\n<h4>11.1 \u6570\u7ec4\u5408\u5e76<\/h4>\n<p>let arr1 &#061; [&#034;\u5b59\u609f\u7a7a&#034;, &#034;\u732a\u516b\u6212&#034;];<br \/>\nlet arr2 &#061; [&#034;\u5510\u50e7&#034;];<br \/>\nlet arr3 &#061; [&#034;\u5ae6\u5a25&#034;];<\/p>\n<p>\/\/ concat()\u65b9\u6cd5<br \/>\nlet merged &#061; arr1.concat(arr2, arr3);<\/p>\n<p>\/\/ \u6269\u5c55\u8fd0\u7b97\u7b26&#xff08;ES6&#xff09;<br \/>\nlet merged2 &#061; [&#8230;arr1, &#8230;arr2, &#8230;arr3];<\/p>\n<h4>11.2 \u6570\u7ec4\u8f6c\u5b57\u7b26\u4e32<\/h4>\n<p>let arr &#061; [&#034;\u5b59\u609f\u7a7a&#034;, &#034;\u732a\u516b\u6212&#034;, &#034;\u6c99\u548c\u5c1a&#034;];<\/p>\n<p>let str &#061; arr.join();       \/\/ &#034;\u5b59\u609f\u7a7a,\u732a\u516b\u6212,\u6c99\u548c\u5c1a&#034;<br \/>\nstr &#061; arr.join(&#034;||&#034;);       \/\/ &#034;\u5b59\u609f\u7a7a||\u732a\u516b\u6212||\u6c99\u548c\u5c1a&#034;<br \/>\nstr &#061; arr.toString();       \/\/ &#034;\u5b59\u609f\u7a7a,\u732a\u516b\u6212,\u6c99\u548c\u5c1a&#034;<\/p>\n<h4>11.3 \u5b57\u7b26\u4e32\u8f6c\u6570\u7ec4<\/h4>\n<p>let str &#061; &#034;red,orange,yellow&#034;;<br \/>\nlet arr &#061; str.split(&#034;,&#034;);   \/\/ [&#034;red&#034;, &#034;orange&#034;, &#034;yellow&#034;]<\/p>\n<h4>11.4 \u6570\u7ec4\u53cd\u8f6c<\/h4>\n<p>arr.reverse(); \/\/ \u539f\u5730\u53cd\u8f6c&#xff0c;\u6539\u53d8\u539f\u6570\u7ec4<\/p>\n<h4>11.5 \u6570\u7ec4\u6392\u5e8f<\/h4>\n<p>let arr &#061; [5, 4, 5, 12, 11, 65, 82, 3];<\/p>\n<p>\/\/ \u9ed8\u8ba4\u6309Unicode\u7f16\u7801\u6392\u5e8f&#xff08;\u53ef\u80fd\u4e0d\u6b63\u786e&#xff09;<br \/>\narr.sort();<\/p>\n<p>\/\/ \u81ea\u5b9a\u4e49\u6392\u5e8f\u89c4\u5219<br \/>\narr.sort(function(a, b) {<br \/>\n    return a &#8211; b; \/\/ \u5347\u5e8f<br \/>\n    \/\/ return b &#8211; a; \/\/ \u964d\u5e8f<br \/>\n});<\/p>\n<p>\/\/ \u5bf9\u8c61\u6570\u7ec4\u6392\u5e8f<br \/>\nlet objArr &#061; [{num: 10}, {num: 20}, {num: 1}];<br \/>\nobjArr.sort(function(a, b) {<br \/>\n    return a.num &#8211; b.num; \/\/ \u6309num\u5c5e\u6027\u5347\u5e8f<br \/>\n});<\/p>\n<p>\/\/ \u968f\u673a\u6392\u5e8f<br \/>\narr.sort(function(a, b) {<br \/>\n    return Math.random() &#8211; 0.5; \/\/ 50%\u6982\u7387\u6b63\u8d1f<br \/>\n});<\/p>\n<hr \/>\n<h3>\u5341\u4e8c\u3001\u6570\u7ec4\u9ad8\u7ea7\u65b9\u6cd5&#xff1a;filter()<\/h3>\n<p>filter()\u65b9\u6cd5\u7528\u4e8e\u8fc7\u6ee4\u6570\u7ec4&#xff0c;\u8fd4\u56de\u4e00\u4e2a\u65b0\u6570\u7ec4&#xff0c;\u5305\u542b\u6240\u6709\u901a\u8fc7\u6d4b\u8bd5\u7684\u5143\u7d20\u3002<\/p>\n<p>let list &#061; [32, 93, 77, 53, 38, 87];<br \/>\nlet filtered &#061; list.filter(function(item) {<br \/>\n    return item &gt; 60; \/\/ \u8fd4\u56de\u5927\u4e8e60\u7684\u5143\u7d20<br \/>\n});<\/p>\n<p>console.log(filtered); \/\/ [93, 77, 87]<\/p>\n<hr \/>\n<h3>\u603b\u7ed3<\/h3>\n<p>\u672c\u6587\u7cfb\u7edf\u68b3\u7406\u4e86JavaScript\u6570\u7ec4\u7684\u5b8c\u6574\u77e5\u8bc6\u4f53\u7cfb&#xff1a;<\/p>\n<table>\n<tr>\n<p>\u4e3b\u9898<\/p>\n<p>\u6838\u5fc3\u8981\u70b9<\/p>\n<\/tr>\n<tbody>\n<tr>\n<td>\n<p>\u6570\u7ec4\u6982\u5ff5\u200b<\/p>\n<\/td>\n<td>\n<p>\u6709\u5e8f\u6570\u636e\u96c6\u5408&#xff0c;\u6570\u5b57\u7d22\u5f15&#xff0c;\u5b58\u50a8\u6027\u80fd\u4f18\u4e8e\u666e\u901a\u5bf9\u8c61<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u521b\u5efa\u65b9\u5f0f\u200b<\/p>\n<\/td>\n<td>\n<p>\u5b57\u9762\u91cf&#xff08;\u63a8\u8350&#xff09;\u548c\u6784\u9020\u51fd\u6570<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u57fa\u672c\u64cd\u4f5c\u200b<\/p>\n<\/td>\n<td>\n<p>\u8bfb\u53d6\u3001\u6dfb\u52a0\u3001\u4fee\u6539\u3001length\u5c5e\u6027<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u6570\u636e\u7c7b\u578b\u200b<\/p>\n<\/td>\n<td>\n<p>\u53ef\u5b58\u653e\u4efb\u610f\u7c7b\u578b&#xff0c;\u5305\u62ec\u5bf9\u8c61\u3001\u51fd\u6570\u3001\u6570\u7ec4<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u68c0\u6d4b\u65b9\u6cd5\u200b<\/p>\n<\/td>\n<td>\n<p>Array.isArray() \u6700\u63a8\u8350<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u904d\u5386\u65b9\u6cd5\u200b<\/p>\n<\/td>\n<td>\n<p>for\u3001for&#8230;in\u3001for&#8230;of\u3001forEach<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u6392\u5e8f\u7b97\u6cd5\u200b<\/p>\n<\/td>\n<td>\n<p>\u5192\u6ce1\u6392\u5e8f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u589e\u5220\u64cd\u4f5c\u200b<\/p>\n<\/td>\n<td>\n<p>push\/pop\u3001unshift\/shift<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u622a\u53d6\u5220\u9664\u200b<\/p>\n<\/td>\n<td>\n<p>slice&#xff08;\u4e0d\u6539\u53d8\u539f\u6570\u7ec4&#xff09;\u3001splice&#xff08;\u6539\u53d8\u539f\u6570\u7ec4&#xff09;<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u67e5\u627e\u65b9\u6cd5\u200b<\/p>\n<\/td>\n<td>\n<p>indexOf\u3001lastIndexOf\u3001includes<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u8f6c\u6362\u65b9\u6cd5\u200b<\/p>\n<\/td>\n<td>\n<p>concat\u3001join\u3001split\u3001reverse\u3001sort<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u9ad8\u7ea7\u65b9\u6cd5\u200b<\/p>\n<\/td>\n<td>\n<p>filter\u8fc7\u6ee4\u6570\u7ec4<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u638c\u63e1\u8fd9\u4e9b\u5185\u5bb9&#xff0c;\u4f60\u5c31\u5177\u5907\u4e86\u719f\u7ec3\u64cd\u4f5cJavaScript\u6570\u7ec4\u7684\u80fd\u529b\u3002\u6570\u7ec4\u662f\u65e5\u5e38\u5f00\u53d1\u4e2d\u4f7f\u7528\u9891\u7387\u6700\u9ad8\u7684\u6570\u636e\u7ed3\u6784\u4e4b\u4e00&#xff0c;\u5efa\u8bae\u591a\u52a0\u7ec3\u4e60&#xff0c;\u719f\u80fd\u751f\u5de7&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00\u6570\u7ec4\u662fJavaScript\u4e2d\u6700\u5e38\u7528\u7684\u6570\u636e\u7ed3\u6784\u4e4b\u4e00\u3002\u672c\u6587\u5c06\u7cfb\u7edf\u8bb2\u89e3\u6570\u7ec4\u7684\u6982\u5ff5\u3001\u521b\u5efa\u65b9\u5f0f\u3001\u57fa\u672c\u64cd\u4f5c\u3001\u904d\u5386\u65b9\u6cd5\u3001\u6392\u5e8f\u7b97\u6cd5\u3001\u589e\u5220\u6539\u67e5\u4ee5\u53ca\u9ad8\u7ea7\u65b9\u6cd5&#xff0c;\u6db5\u76d6\u6570\u7ec4\u76f8\u5173\u7684\u6240\u6709\u6838\u5fc3\u77e5\u8bc6\u70b9\u3002\u65e0\u8bba\u4f60\u662f\u521d\u5b66\u8005\u8fd8\u662f\u6709\u4e00\u5b9a\u7ecf\u9a8c\u7684\u5f00\u53d1\u8005&#xff0c;\u90fd\u80fd\u4ece\u4e2d\u83b7\u5f97\u6536\u83b7\u3002\u4e00\u3001\u6570\u7ec4\u7684\u6982\u5ff5\u6570\u7ec4\u662f\u6307\u4e00\u7ec4\u6709\u5e8f\u6570\u636e\u7684\u96c6\u5408&#xff0c;\u5176\u4e2d\u6bcf\u4e2a\u6570\u636e\u88ab\u79f0\u4e3a\u5143\u7d20\u3002\u6570\u7ec4\u4e2d\u53ef\u4ee5\u5b58\u653e\u4efb\u610f\u7c7b\u578b\u7684\u5143\u7d20&#xff0c;\u5b83\u662f\u5c06\u4e00\u7ec4\u6570\u636e\u5b58\u50a8\u5728\u5355\u4e2a\u53d8\u91cf\u540d\u4e0b\u7684\u4f18\u96c5\u65b9\u5f0f\u30021.1 \u6570\u7ec4\u4e0e\u666e\u901a\u5bf9\u8c61\u7684\u533a\u522b\u5bf9\u6bd4\u9879\u666e\u901a\u5bf9\u8c61\u6570\u7ec4\u5c5e\u6027\u540d\u200b\u5b57<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[187,87,190],"topic":[],"class_list":["post-83385","post","type-post","status-publish","format-standard","hentry","category-server","tag-javascript","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>JS\u6570\u7ec4\u5b8c\u5168\u6307\u5357\uff08\u542b\u5341\u5927\u64cd\u4f5c\u8be6\u89e3\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\/83385.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JS\u6570\u7ec4\u5b8c\u5168\u6307\u5357\uff08\u542b\u5341\u5927\u64cd\u4f5c\u8be6\u89e3\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u524d\u8a00\u6570\u7ec4\u662fJavaScript\u4e2d\u6700\u5e38\u7528\u7684\u6570\u636e\u7ed3\u6784\u4e4b\u4e00\u3002\u672c\u6587\u5c06\u7cfb\u7edf\u8bb2\u89e3\u6570\u7ec4\u7684\u6982\u5ff5\u3001\u521b\u5efa\u65b9\u5f0f\u3001\u57fa\u672c\u64cd\u4f5c\u3001\u904d\u5386\u65b9\u6cd5\u3001\u6392\u5e8f\u7b97\u6cd5\u3001\u589e\u5220\u6539\u67e5\u4ee5\u53ca\u9ad8\u7ea7\u65b9\u6cd5&#xff0c;\u6db5\u76d6\u6570\u7ec4\u76f8\u5173\u7684\u6240\u6709\u6838\u5fc3\u77e5\u8bc6\u70b9\u3002\u65e0\u8bba\u4f60\u662f\u521d\u5b66\u8005\u8fd8\u662f\u6709\u4e00\u5b9a\u7ecf\u9a8c\u7684\u5f00\u53d1\u8005&#xff0c;\u90fd\u80fd\u4ece\u4e2d\u83b7\u5f97\u6536\u83b7\u3002\u4e00\u3001\u6570\u7ec4\u7684\u6982\u5ff5\u6570\u7ec4\u662f\u6307\u4e00\u7ec4\u6709\u5e8f\u6570\u636e\u7684\u96c6\u5408&#xff0c;\u5176\u4e2d\u6bcf\u4e2a\u6570\u636e\u88ab\u79f0\u4e3a\u5143\u7d20\u3002\u6570\u7ec4\u4e2d\u53ef\u4ee5\u5b58\u653e\u4efb\u610f\u7c7b\u578b\u7684\u5143\u7d20&#xff0c;\u5b83\u662f\u5c06\u4e00\u7ec4\u6570\u636e\u5b58\u50a8\u5728\u5355\u4e2a\u53d8\u91cf\u540d\u4e0b\u7684\u4f18\u96c5\u65b9\u5f0f\u30021.1 \u6570\u7ec4\u4e0e\u666e\u901a\u5bf9\u8c61\u7684\u533a\u522b\u5bf9\u6bd4\u9879\u666e\u901a\u5bf9\u8c61\u6570\u7ec4\u5c5e\u6027\u540d\u200b\u5b57\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/83385.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-25T13:33:20+00:00\" \/>\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=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/83385.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/83385.html\",\"name\":\"JS\u6570\u7ec4\u5b8c\u5168\u6307\u5357\uff08\u542b\u5341\u5927\u64cd\u4f5c\u8be6\u89e3\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-25T13:33:20+00:00\",\"dateModified\":\"2026-07-25T13:33:20+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/83385.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/83385.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/83385.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JS\u6570\u7ec4\u5b8c\u5168\u6307\u5357\uff08\u542b\u5341\u5927\u64cd\u4f5c\u8be6\u89e3\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":"JS\u6570\u7ec4\u5b8c\u5168\u6307\u5357\uff08\u542b\u5341\u5927\u64cd\u4f5c\u8be6\u89e3\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\/83385.html","og_locale":"zh_CN","og_type":"article","og_title":"JS\u6570\u7ec4\u5b8c\u5168\u6307\u5357\uff08\u542b\u5341\u5927\u64cd\u4f5c\u8be6\u89e3\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u524d\u8a00\u6570\u7ec4\u662fJavaScript\u4e2d\u6700\u5e38\u7528\u7684\u6570\u636e\u7ed3\u6784\u4e4b\u4e00\u3002\u672c\u6587\u5c06\u7cfb\u7edf\u8bb2\u89e3\u6570\u7ec4\u7684\u6982\u5ff5\u3001\u521b\u5efa\u65b9\u5f0f\u3001\u57fa\u672c\u64cd\u4f5c\u3001\u904d\u5386\u65b9\u6cd5\u3001\u6392\u5e8f\u7b97\u6cd5\u3001\u589e\u5220\u6539\u67e5\u4ee5\u53ca\u9ad8\u7ea7\u65b9\u6cd5&#xff0c;\u6db5\u76d6\u6570\u7ec4\u76f8\u5173\u7684\u6240\u6709\u6838\u5fc3\u77e5\u8bc6\u70b9\u3002\u65e0\u8bba\u4f60\u662f\u521d\u5b66\u8005\u8fd8\u662f\u6709\u4e00\u5b9a\u7ecf\u9a8c\u7684\u5f00\u53d1\u8005&#xff0c;\u90fd\u80fd\u4ece\u4e2d\u83b7\u5f97\u6536\u83b7\u3002\u4e00\u3001\u6570\u7ec4\u7684\u6982\u5ff5\u6570\u7ec4\u662f\u6307\u4e00\u7ec4\u6709\u5e8f\u6570\u636e\u7684\u96c6\u5408&#xff0c;\u5176\u4e2d\u6bcf\u4e2a\u6570\u636e\u88ab\u79f0\u4e3a\u5143\u7d20\u3002\u6570\u7ec4\u4e2d\u53ef\u4ee5\u5b58\u653e\u4efb\u610f\u7c7b\u578b\u7684\u5143\u7d20&#xff0c;\u5b83\u662f\u5c06\u4e00\u7ec4\u6570\u636e\u5b58\u50a8\u5728\u5355\u4e2a\u53d8\u91cf\u540d\u4e0b\u7684\u4f18\u96c5\u65b9\u5f0f\u30021.1 \u6570\u7ec4\u4e0e\u666e\u901a\u5bf9\u8c61\u7684\u533a\u522b\u5bf9\u6bd4\u9879\u666e\u901a\u5bf9\u8c61\u6570\u7ec4\u5c5e\u6027\u540d\u200b\u5b57","og_url":"https:\/\/www.wsisp.com\/helps\/83385.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-25T13:33:20+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/83385.html","url":"https:\/\/www.wsisp.com\/helps\/83385.html","name":"JS\u6570\u7ec4\u5b8c\u5168\u6307\u5357\uff08\u542b\u5341\u5927\u64cd\u4f5c\u8be6\u89e3\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-25T13:33:20+00:00","dateModified":"2026-07-25T13:33:20+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/83385.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/83385.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/83385.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"JS\u6570\u7ec4\u5b8c\u5168\u6307\u5357\uff08\u542b\u5341\u5927\u64cd\u4f5c\u8be6\u89e3\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\/83385","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=83385"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/83385\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=83385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=83385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=83385"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=83385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}