{"id":1683,"date":"2024-11-10T14:29:58","date_gmt":"2024-11-10T06:29:58","guid":{"rendered":"https:\/\/fwq.ai\/blog\/1683\/"},"modified":"2024-11-10T14:29:58","modified_gmt":"2024-11-10T06:29:58","slug":"%e5%a6%82%e4%bd%95%e7%94%a8-javascript-%e5%a3%b0%e6%98%8e%e5%92%8c%e8%b5%8b%e5%80%bc%e4%ba%8c%e7%bb%b4%e6%95%b0%e7%bb%84%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/1683\/","title":{"rendered":"\u5982\u4f55\u7528 JavaScript \u58f0\u660e\u548c\u8d4b\u503c\u4e8c\u7ef4\u6570\u7ec4\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173053426429054.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u7528 JavaScript \u58f0\u660e\u548c\u8d4b\u503c\u4e8c\u7ef4\u6570\u7ec4\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u7528 JavaScript \u58f0\u660e\u548c\u8d4b\u503c\u4e8c\u7ef4\u6570\u7ec4\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u4e8c\u7ef4\u6570\u7ec4\u5728 javascript \u4e2d\u7684\u58f0\u660e\u4e0e\u8d4b\u503c<\/strong><\/p>\n<p>\u5728 javascript \u4e2d\uff0c\u58f0\u660e\u548c\u8d4b\u503c\u4e00\u4e2a\u4e8c\u7ef4\u6570\u7ec4\u4e0e\u58f0\u660e\u548c\u8d4b\u503c\u4e00\u822c\u6570\u7ec4\u7684\u65b9\u6cd5\u7565\u6709\u4e0d\u540c\uff0c\u7ef4\u5ea6\u95f4\u7684\u62ec\u53f7\u4e5f\u4e0d\u540c\u3002<\/p>\n<p><strong>\u58f0\u660e<\/strong><\/p>\n<p>\u8981\u58f0\u660e\u4e00\u4e2a\u4e8c\u7ef4\u6570\u7ec4\uff0c\u9700\u8981\u5148\u58f0\u660e\u4e00\u4e2a\u666e\u901a\u6570\u7ec4\uff0c\u7136\u540e\u4e3a\u6bcf\u4e2a\u5143\u7d20\u518d\u58f0\u660e\u4e00\u4e2a\u5b50\u6570\u7ec4\u3002\u4f8b\u5982\uff1a<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<pre>var lists = [];\nlists[0] = [];\nlists[1] = [];\nlists[2] = [];<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u6837\u5c31\u58f0\u660e\u4e86\u4e00\u4e2a\u5305\u542b\u4e09\u4e2a\u5b50\u6570\u7ec4\u7684\u4e8c\u7ef4\u6570\u7ec4\u3002<\/p>\n<p><strong>\u8d4b\u503c<\/strong><\/p>\n<p>\u7ed9\u4e8c\u7ef4\u6570\u7ec4\u4e2d\u6bcf\u4e2a\u5143\u7d20\u8d4b\u503c\u65f6\uff0c\u9700\u8981\u5206\u522b\u7ed9\u6bcf\u4e2a\u5b50\u6570\u7ec4\u8d4b\u503c\u3002\u4ee5\u4e0b\u4ee3\u7801\u793a\u4f8b\u8bf4\u660e\u5982\u4f55\u7ed9 lists \u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u8d4b\u503c\uff1a<\/p>\n<pre>lists[0][0] = \"one\";\nlists[0][1] = \"two\";\nlists[0][2] = \"three\";\nlists[0][3] = \"four\";\n\nlists[1][0] = ...;  \/\/ \u7ed9\u7b2c\u4e8c\u884c\u8d4b\u503c\n\nlists[2][0] = ...;  \/\/ \u7ed9\u7b2c\u4e09\u884c\u8d4b\u503c<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u5728\u8d4b\u503c\u524d\u5e94\u786e\u4fdd\u5b50\u6570\u7ec4\u5df2\u58f0\u660e\u3002\u4f8b\u5982\uff0c\u4ee5\u4e0b\u4ee3\u7801\u5c06\u5bfc\u81f4\u9519\u8bef\uff1a<\/p>\n<pre>lists[0][0] = \"One\"; \/\/ lists[0] \u5df2\u58f0\u660e\n\nlists[1][0] = \"Two\"; \/\/ lists[1] \u672a\u58f0\u660e<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u56e0\u6b64\uff0c\u5728\u8d4b\u503c\u524d\u5e94\u5148\u58f0\u660e\u6240\u6709\u5b50\u6570\u7ec4\uff0c\u5c31\u50cf\u4e0a\u9762\u7684\u4ee3\u7801\u793a\u4f8b\u4e2d\u90a3\u6837\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u7528 JavaScript \u58f0\u660e\u548c\u8d4b\u503c\u4e8c\u7ef4\u6570\u7ec4\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e8c\u7ef4\u6570\u7ec4\u5728 javascript \u4e2d\u7684\u58f0\u660e\u4e0e\u8d4b\u503c \u5728 javascript \u4e2d\uff0c\u58f0\u660e\u548c\u8d4b\u503c\u4e00\u4e2a\u4e8c\u7ef4\u6570\u7ec4\u4e0e\u58f0\u660e\u548c\u8d4b\u503c\u4e00\u822c\u6570\u7ec4\u7684\u65b9\u6cd5\u7565\u6709\u4e0d\u540c\uff0c\u7ef4\u5ea6\u95f4\u7684\u62ec\u53f7\u4e5f\u4e0d\u540c\u3002 \u58f0\u660e \u8981\u58f0\u660e\u4e00\u4e2a\u4e8c\u7ef4\u6570\u7ec4\uff0c\u9700\u8981\u5148\u58f0\u660e\u4e00\u4e2a\u666e\u901a\u6570\u7ec4\uff0c\u7136\u540e\u4e3a\u6bcf\u4e2a\u5143\u7d20\u518d\u58f0\u660e\u4e00\u4e2a\u5b50\u6570\u7ec4\u3002\u4f8b\u5982\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b var lists = []; lists[0] = []; lists[1] = []; lists[2] = []; \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u6837\u5c31\u58f0\u660e\u4e86\u4e00\u4e2a\u5305\u542b\u4e09\u4e2a\u5b50\u6570\u7ec4\u7684\u4e8c\u7ef4\u6570\u7ec4\u3002 \u8d4b\u503c \u7ed9\u4e8c\u7ef4\u6570\u7ec4\u4e2d\u6bcf\u4e2a\u5143\u7d20\u8d4b\u503c\u65f6\uff0c\u9700\u8981\u5206\u522b\u7ed9\u6bcf\u4e2a\u5b50\u6570\u7ec4\u8d4b\u503c\u3002\u4ee5\u4e0b\u4ee3\u7801\u793a\u4f8b\u8bf4\u660e\u5982\u4f55\u7ed9 lists \u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u8d4b\u503c\uff1a lists[0][0] = &#8220;one&#8221;; lists[0][1] = &#8220;two&#8221;; lists[0][2] = &#8220;three&#8221;; lists[0][3] = &#8220;four&#8221;; lists[1][0] = &#8230;; \/\/ \u7ed9\u7b2c\u4e8c\u884c\u8d4b\u503c lists[2][0] = &#8230;; \/\/ \u7ed9\u7b2c\u4e09\u884c\u8d4b\u503c \u767b\u5f55\u540e\u590d\u5236 \u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0c\u5728\u8d4b\u503c\u524d\u5e94\u786e\u4fdd\u5b50\u6570\u7ec4\u5df2\u58f0\u660e\u3002\u4f8b\u5982\uff0c\u4ee5\u4e0b\u4ee3\u7801\u5c06\u5bfc\u81f4\u9519\u8bef\uff1a lists[0][0] = &#8220;One&#8221;; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-1683","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1683","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=1683"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1683\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=1683"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=1683"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=1683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}