{"id":52043,"date":"2024-12-03T11:41:06","date_gmt":"2024-12-03T03:41:06","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52043\/"},"modified":"2024-12-03T11:41:06","modified_gmt":"2024-12-03T03:41:06","slug":"%e7%90%86%e8%a7%a3-javascript-%e6%95%b0%e7%bb%84-map-%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52043\/","title":{"rendered":"\u7406\u89e3 JavaScript \u6570\u7ec4 map() \u65b9\u6cd5"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u7406\u89e3 JavaScript \u6570\u7ec4 map() \u65b9\u6cd5<\/h1>\n<p><span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span>    <\/p>\n<p>\u5c0f\u4f19\u4f34\u4eec\u6709\u6ca1\u6709\u89c9\u5f97\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u5f88\u6709\u610f\u601d\uff1f\u6709\u610f\u601d\u5c31\u5bf9\u4e86\uff01\u4eca\u5929\u5c31\u7ed9\u5927\u5bb6\u5e26\u6765<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u7406\u89e3 JavaScript \u6570\u7ec4 map() \u65b9\u6cd5\u300b<\/span>\uff0c\u4ee5\u4e0b\u5185\u5bb9\u5c06\u4f1a\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\uff0c\u82e5\u662f\u5728\u5b66\u4e60\u4e2d\u5bf9\u5176\u4e2d\u90e8\u5206\u77e5\u8bc6\u70b9\u6709\u7591\u95ee\uff0c\u6216\u8bb8\u770b\u4e86\u672c\u6587\u5c31\u80fd\u5e2e\u5230\u4f60\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241118\/1731930169673b28390f59b.jpg\" class=\"aligncenter\" title=\"\u7406\u89e3 JavaScript \u6570\u7ec4 map() \u65b9\u6cd5\u63d2\u56fe\" alt=\"\u7406\u89e3 JavaScript \u6570\u7ec4 map() \u65b9\u6cd5\u63d2\u56fe\" \/><\/p>\n<h2> <strong>map()\u7b80\u4ecb<\/strong> <\/h2>\n<p>map() \u65b9\u6cd5\u521b\u5efa\u4e00\u4e2a\u65b0\u6570\u7ec4\uff0c\u5176\u4e2d\u586b\u5145\u4e86\u5bf9\u8c03\u7528\u6570\u7ec4\u4e2d\u6bcf\u4e2a\u5143\u7d20\u8c03\u7528\u6240\u63d0\u4f9b\u51fd\u6570\u7684\u7ed3\u679c\u3002\u5b83\u662f\u4e00\u79cd\u51fd\u6570\u5f0f\u7f16\u7a0b\u6280\u672f\uff0c\u5141\u8bb8\u60a8\u5c06\u6570\u7ec4\u7684\u6bcf\u4e2a\u5143\u7d20\u8f6c\u6362\u4e3a\u65b0\u5143\u7d20\uff0c\u4ece\u800c\u751f\u6210\u65b0\u6570\u7ec4\u800c\u4e0d\u4fee\u6539\u539f\u59cb\u6570\u7ec4\u3002<\/p>\n<hr>\n<h2> <strong>\u8bed\u6cd5<\/strong> <\/h2>\n<pre>let newarray = array.map(function callback(currentvalue, index, array) {\n    \/\/ return element for newarray\n}, thisarg);\n<\/pre>\n<p>\u6216\u8005\uff0c\u4f7f\u7528\u7bad\u5934\u51fd\u6570\uff1a<\/p>\n<pre>let newarray = array.map((currentvalue, index, array) =&gt; {\n    \/\/ return element for newarray\n});\n<\/pre>\n<hr>\n<h2> <strong>\u53c2\u6570<\/strong> <\/h2>\n<ul>\n<li> <strong>callback<\/strong>\uff1a\u751f\u6210\u65b0\u6570\u7ec4\u5143\u7d20\u7684\u51fd\u6570\uff0c\u91c7\u7528\u4e09\u4e2a\u53c2\u6570\uff1a\n<ul>\n<li> <strong>currentvalue<\/strong>\uff1a\u5f53\u524d\u6b63\u5728\u5904\u7406\u7684\u5143\u7d20\u3002<\/li>\n<li> <strong>index<\/strong> <em>\uff08\u53ef\u9009\uff09<\/em>\uff1a\u5f53\u524d\u5143\u7d20\u7684\u7d22\u5f15\u3002<\/li>\n<li> <strong>\u6570\u7ec4<\/strong> <em>\uff08\u53ef\u9009\uff09<\/em>\uff1a\u8c03\u7528\u4e86\u6570\u7ec4\u6620\u5c04\u3002<\/li>\n<\/ul>\n<\/li>\n<li> <strong>thisarg<\/strong> <em>\uff08\u53ef\u9009\uff09<\/em>\uff1a\u6267\u884c\u56de\u8c03\u65f6\u7528\u4f5c this \u7684\u503c\u3002<\/li>\n<\/ul>\n<hr>\n<h2> <strong>\u8fd4\u56de\u503c<\/strong> <\/h2>\n<p>\u4e00\u4e2a\u65b0\u6570\u7ec4\uff0c\u6bcf\u4e2a\u5143\u7d20\u90fd\u662f\u56de\u8c03\u51fd\u6570\u7684\u7ed3\u679c\u3002<\/p>\n<hr>\n<h2> <strong>map() \u7684\u5de5\u4f5c\u539f\u7406<\/strong> <\/h2>\n<ul>\n<li> <strong>\u4e0d\u53d8\u6027<\/strong>\uff1amap() \u4e0d\u4f1a\u4fee\u6539\u539f\u59cb\u6570\u7ec4\u3002<\/li>\n<li> <strong>\u9010\u5143\u7d20\u8f6c\u6362<\/strong>\uff1a\u5c06\u56de\u8c03\u51fd\u6570\u5e94\u7528\u4e8e\u6bcf\u4e2a\u5143\u7d20\u3002<\/li>\n<li> <strong>\u8fd4\u56de\u4e00\u4e2a\u65b0\u6570\u7ec4<\/strong>\uff1a\u5c06\u7ed3\u679c\u6536\u96c6\u5230\u4e00\u4e2a\u65b0\u6570\u7ec4\u4e2d\u3002<\/li>\n<\/ul>\n<hr>\n<h2> <strong>\u793a\u4f8b<\/strong> <\/h2>\n<h3> <strong>a.\u6620\u5c04\u6570\u5b57<\/strong> <\/h3>\n<p><strong>\u793a\u4f8b<\/strong>\uff1a\u5c06\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u6570\u5b57\u4e58\u4ee5 2\u3002<\/p>\n<pre>const numbers = [1, 2, 3, 4, 5];\nconst doubled = numbers.map(number =&gt; number * 2);\n\nconsole.log(doubled); \/\/ output: [2, 4, 6, 8, 10]\n<\/pre>\n<h3> <strong>b.\u53d8\u6362\u5b57\u7b26\u4e32<\/strong> <\/h3>\n<p><strong>\u793a\u4f8b<\/strong>\uff1a\u5c06\u5b57\u7b26\u4e32\u6570\u7ec4\u8f6c\u6362\u4e3a\u5927\u5199\u3002<\/p>\n<pre>const fruits = ['apple', 'banana', 'cherry'];\nconst upperfruits = fruits.map(fruit =&gt; fruit.touppercase());\n\nconsole.log(upperfruits); \/\/ output: ['apple', 'banana', 'cherry']\n<\/pre>\n<h3> <strong>c.\u63d0\u53d6\u5bf9\u8c61\u5c5e\u6027<\/strong> <\/h3>\n<p><strong>\u793a\u4f8b<\/strong>\uff1a\u4ece\u5bf9\u8c61\u6570\u7ec4\u4e2d\u63d0\u53d6\u7279\u5b9a\u5c5e\u6027\u3002<\/p>\n<pre>const users = [\n  { id: 1, name: 'alice' },\n  { id: 2, name: 'bob' },\n];\nconst names = users.map(user =&gt; user.name);\n\nconsole.log(names); \/\/ output: ['alice', 'bob']\n<\/pre>\n<h3> <strong>d.\u6620\u5c04\u5bf9\u8c61\u6570\u7ec4<\/strong> <\/h3>\n<p><strong>\u793a\u4f8b<\/strong>\uff1a\u8f6c\u6362\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5bf9\u8c61\u3002<\/p>\n<pre>const products = [\n  { productid: 1, price: 100 },\n  { productid: 2, price: 200 },\n];\nconst discountedproducts = products.map(product =&gt; ({\n  ...product,\n  price: product.price * 0.9,\n}));\n\nconsole.log(discountedproducts);\n\/\/ output:\n\/\/ [\n\/\/   { productid: 1, price: 90 },\n\/\/   { productid: 2, price: 180 },\n\/\/ ]\n<\/pre>\n<hr>\n<h2> <strong>map() \u548c foreach() \u4e4b\u95f4\u7684\u533a\u522b<\/strong> <\/h2>\n<ul>\n<li> <strong>\u5730\u56fe()<\/strong>\uff1a\n<ul>\n<li>\u8fd4\u56de\u4e00\u4e2a\u65b0\u6570\u7ec4\u3002<\/li>\n<li>\u5f53\u60a8\u60f3\u8981\u8f6c\u6362\u6bcf\u4e2a\u5143\u7d20\u5e76\u6536\u96c6\u7ed3\u679c\u65f6\u4f7f\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<li> <strong>foreach()<\/strong>\uff1a\n<ul>\n<li>\u8fd4\u56de\u672a\u5b9a\u4e49\u3002<\/li>\n<li>\u5f53\u60a8\u60f3\u8981\u6267\u884c\u526f\u4f5c\u7528\uff08\u4f8b\u5982\uff0c\u8bb0\u5f55\u65e5\u5fd7\u3001\u4fee\u6539\u5916\u90e8\u53d8\u91cf\uff09\u5e76\u4e14\u4e0d\u9700\u8981\u65b0\u6570\u7ec4\u65f6\u4f7f\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>foreach() \u793a\u4f8b<\/strong>:<\/p>\n<pre>const numbers = [1, 2, 3];\nnumbers.foreach(number =&gt; console.log(number * 2));\n\/\/ output: 2, 4, 6\n<\/pre>\n<hr>\n<h2> <strong>\u5c06 map() \u4e0e\u7bad\u5934\u51fd\u6570\u7ed3\u5408\u4f7f\u7528<\/strong> <\/h2>\n<p>\u7bad\u5934\u51fd\u6570\u63d0\u4f9b\u4e86\u7f16\u5199\u56de\u8c03\u51fd\u6570\u7684\u7b80\u6d01\u8bed\u6cd5\u3002<\/p>\n<p><strong>\u793a\u4f8b<\/strong>\uff1a<\/p>\n<pre>const numbers = [1, 2, 3];\nconst squared = numbers.map(n =&gt; n * n);\n\nconsole.log(squared); \/\/ output: [1, 4, 9]\n<\/pre>\n<hr>\n<h2> <strong>typescript \u4e2d\u7684 map()<\/strong> <\/h2>\n<p>typescript \u4e3a javascript \u6dfb\u52a0\u4e86\u9759\u6001\u7c7b\u578b\uff0c\u8fd9\u6709\u52a9\u4e8e\u5728\u7f16\u8bd1\u65f6\u6355\u83b7\u9519\u8bef\u3002<\/p>\n<h3> <strong>a.\u8f93\u5165\u6ce8\u91ca<\/strong> <\/h3>\n<p>\u60a8\u53ef\u4ee5\u6307\u5b9a\u6570\u7ec4\u4e2d\u5143\u7d20\u7684\u7c7b\u578b\u548c\u8fd4\u56de\u7c7b\u578b\u3002<\/p>\n<p><strong>\u793a\u4f8b<\/strong>\uff1a<\/p>\n<pre>const numbers: number[] = [1, 2, 3];\nconst strings: string[] = numbers.map((num: number): string =&gt; num.tostring());\n\nconsole.log(strings); \/\/ output: ['1', '2', '3']\n<\/pre>\n<h3> <strong>b.\u901a\u7528\u7c7b\u578b<\/strong> <\/h3>\n<p>\u60a8\u53ef\u4ee5\u5b9a\u4e49\u901a\u7528\u51fd\u6570\u6765\u5904\u7406\u4efb\u4f55\u7c7b\u578b\u3002<\/p>\n<p><strong>\u793a\u4f8b<\/strong>\uff1a<\/p>\n<pre>function identitymap&lt;t&gt;(array: t[]): t[] {\n  return array.map(element =&gt; element);\n}\n\nconst result = identitymap&lt;number&gt;([1, 2, 3]);\nconsole.log(result); \/\/ output: [1, 2, 3]\n<\/pre>\n<hr>\n<h2> <strong>\u5e38\u89c1\u7528\u4f8b<\/strong> <\/h2>\n<ul>\n<li> <strong>\u8f6c\u6362\u6570\u636e<\/strong>\uff1a\u5c06\u6570\u636e\u4ece\u4e00\u79cd\u5f62\u5f0f\u8f6c\u6362\u4e3a\u53e6\u4e00\u79cd\u5f62\u5f0f\u3002<\/li>\n<li> <strong>\u63d0\u53d6\u503c<\/strong>\uff1a\u4ece\u5bf9\u8c61\u4e2d\u63d0\u53d6\u7279\u5b9a\u5b57\u6bb5\u3002<\/li>\n<li> <strong>\u7ec4\u5408\u6570\u636e<\/strong>\uff1a\u6839\u636e\u73b0\u6709\u6570\u636e\u521b\u5efa\u65b0\u6570\u7ec4\u3002<\/li>\n<li> <strong>\u8ba1\u7b97<\/strong>\uff1a\u5bf9\u6bcf\u4e2a\u5143\u7d20\u6267\u884c\u8ba1\u7b97\u3002<\/li>\n<\/ul>\n<hr>\n<h2> <strong>\u9ad8\u7ea7\u4e3b\u9898<\/strong> <\/h2>\n<h3> <strong>a.\u5c06 map() \u4e0e\u5176\u4ed6\u6570\u7ec4\u65b9\u6cd5\u94fe\u63a5<\/strong> <\/h3>\n<p>\u4f60\u53ef\u4ee5\u5c06map()\u4e0e\u5176\u4ed6\u6570\u7ec4\u65b9\u6cd5\u94fe\u63a5\u8d77\u6765\uff0c\u5982filter()\u3001reduce()\u7b49<\/p>\n<p><strong>\u793a\u4f8b<\/strong>\uff1a<\/p>\n<pre>const numbers = [1, 2, 3, 4, 5, 6];\nconst evendoubled = numbers\n  .filter(n =&gt; n % 2 === 0)\n  .map(n =&gt; n * 2);\n\nconsole.log(evendoubled); \/\/ output: [4, 8, 12]\n<\/pre>\n<h3> <strong>b.\u5904\u7406\u5f02\u6b65\u64cd\u4f5c<\/strong> <\/h3>\n<p>map() \u4e0d\u5904\u7406\u56de\u8c03\u5185\u7684\u5f02\u6b65\u64cd\u4f5c\u3002\u5982\u679c\u9700\u8981\u6267\u884c\u5f02\u6b65\u64cd\u4f5c\uff0c\u8bf7\u8003\u8651\u4f7f\u7528 promise.all() \u548c map()\u3002<\/p>\n<p><strong>\u793a\u4f8b<\/strong>\uff1a<\/p>\n<pre>const urls = ['url1', 'url2', 'url3'];\n\nconst fetchPromises = urls.map(url =&gt; fetch(url));\n\nPromise.all(fetchPromises)\n  .then(responses =&gt; {\n    \/\/ Handle responses\n  })\n  .catch(error =&gt; {\n    \/\/ Handle errors\n  });\n<\/pre>\n<hr>\n<h2> <strong>\u6700\u4f73\u5b9e\u8df5<\/strong> <\/h2>\n<ul>\n<li> <strong>\u4e0d\u8981\u4f7f\u7528 map() \u4ea7\u751f\u526f\u4f5c\u7528<\/strong>\uff1a\u5982\u679c\u4e0d\u9700\u8981\u65b0\u6570\u7ec4\uff0c\u8bf7\u4f7f\u7528 foreach()\u3002<\/li>\n<li> <strong>\u907f\u514d\u4fee\u6539\u539f\u59cb\u6570\u7ec4<\/strong>\uff1amap() \u4e0d\u5e94\u6539\u53d8\u539f\u59cb\u6570\u7ec4\u6216\u5176\u5143\u7d20\u3002<\/li>\n<li> <strong>\u8fd4\u56de\u503c<\/strong>\uff1a\u786e\u4fdd\u4f60\u7684\u56de\u8c03\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u503c\uff1b\u5426\u5219\uff0c\u65b0\u6570\u7ec4\u5c06\u5305\u542b\u672a\u5b9a\u4e49\u7684\u5143\u7d20\u3002<\/li>\n<li> <strong>\u4f7f\u7528\u7bad\u5934\u51fd\u6570\u6765\u4fdd\u6301\u7b80\u6d01<\/strong>\uff1a\u5b83\u4eec\u4f7f\u60a8\u7684\u4ee3\u7801\u66f4\u77ed\u4e14\u66f4\u5177\u53ef\u8bfb\u6027\u3002<\/li>\n<\/ul>\n<hr>\n<h2> <strong>\u7ed3\u8bba<\/strong> <\/h2>\n<p>\u7406\u89e3 map() \u51fd\u6570\u5bf9\u4e8e javascript \u548c typescript \u4e2d\u7684\u6709\u6548\u6570\u7ec4\u64cd\u4f5c\u81f3\u5173\u91cd\u8981\u3002\u8fd9\u662f\u4e00\u79cd\u591a\u529f\u80fd\u65b9\u6cd5\uff0c\u53ef\u8ba9\u60a8\u5e72\u51c0\u9ad8\u6548\u5730\u8f6c\u6362\u6570\u636e\u3002\u8bb0\u4f4fmap():<\/p>\n<ul>\n<li>\u521b\u5efa\u4e00\u4e2a\u65b0\u6570\u7ec4\u3002<\/li>\n<li>\u5bf9\u6bcf\u4e2a\u5143\u7d20\u5e94\u7528\u4e00\u4e2a\u51fd\u6570\u3002<\/li>\n<li>\u4e0d\u4fee\u6539\u539f\u59cb\u6570\u7ec4\u3002<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u638c\u63e1map()\uff0c\u60a8\u5c06\u7f16\u5199\u66f4\u7b80\u6d01\u3001\u66f4\u5b9e\u7528\u7684\u4ee3\u7801\uff0c\u4ece\u800c\u83b7\u5f97\u66f4\u597d\u7684\u53ef\u7ef4\u62a4\u6027\u548c\u53ef\u8bfb\u6027\u3002<\/p>\n<p>\u611f\u8c22\u60a8\u7684\u9605\u8bfb\u3002\u5982\u679c\u4f60\u559c\u6b22\u8fd9\u4e2a\u5185\u5bb9\uff0c\u8bf7\u968f\u65f6\u8bf7\u6211\u559d\u676f\u5496\u5561\uff1a<br \/> https:\/\/buymeacoffee.com\/kellyblaire<\/p>\n<p>\u7406\u8bba\u8981\u638c\u63e1\uff0c\u5b9e\u64cd\u4e0d\u80fd\u843d\uff01\u4ee5\u4e0a\u5173\u4e8e\u300a\u7406\u89e3 JavaScript \u6570\u7ec4 map() \u65b9\u6cd5\u300b\u7684\u8be6\u7ec6\u4ecb\u7ecd\uff0c\u5927\u5bb6\u90fd\u638c\u63e1\u4e86\u5427\uff01\u5982\u679c\u60f3\u8981\u7ee7\u7eed\u63d0\u5347\u81ea\u5df1\u7684\u80fd\u529b\uff0c\u90a3\u4e48\u5c31\u6765\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u5427\uff01<\/p>\n<p>      \u7248\u672c\u58f0\u660e \u672c\u6587\u8f6c\u8f7d\u4e8e\uff1adev.to \u5982\u6709\u4fb5\u72af\uff0c\u8bf7\u8054\u7cfb\u5220\u9664    <\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   win7\u600e\u4e48\u66f4\u6539\u542f\u52a8\u9879 win7\u5f00\u673a\u542f\u52a8\u9879\u66f4\u6539\u6559\u7a0b\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u7406\u89e3 JavaScript \u6570\u7ec4 map() \u65b9\u6cd5 \u6536\u85cf \u5c0f\u4f19\u4f34\u4eec\u6709\u6ca1\u6709\u89c9\u5f97\u5b66\u4e60\u6587\u7ae0\u5f88\u6709\u610f\u601d\uff1f\u6709\u610f\u601d\u5c31\u5bf9\u4e86\uff01\u4eca\u5929\u5c31\u7ed9\u5927\u5bb6\u5e26\u6765\u300a\u7406\u89e3 JavaScript \u6570\u7ec4 map() \u65b9\u6cd5\u300b\uff0c\u4ee5\u4e0b\u5185\u5bb9\u5c06\u4f1a\u6d89\u53ca\u5230\uff0c\u82e5\u662f\u5728\u5b66\u4e60\u4e2d\u5bf9\u5176\u4e2d\u90e8\u5206\u77e5\u8bc6\u70b9\u6709\u7591\u95ee\uff0c\u6216\u8bb8\u770b\u4e86\u672c\u6587\u5c31\u80fd\u5e2e\u5230\u4f60\uff01 map()\u7b80\u4ecb map() \u65b9\u6cd5\u521b\u5efa\u4e00\u4e2a\u65b0\u6570\u7ec4\uff0c\u5176\u4e2d\u586b\u5145\u4e86\u5bf9\u8c03\u7528\u6570\u7ec4\u4e2d\u6bcf\u4e2a\u5143\u7d20\u8c03\u7528\u6240\u63d0\u4f9b\u51fd\u6570\u7684\u7ed3\u679c\u3002\u5b83\u662f\u4e00\u79cd\u51fd\u6570\u5f0f\u7f16\u7a0b\u6280\u672f\uff0c\u5141\u8bb8\u60a8\u5c06\u6570\u7ec4\u7684\u6bcf\u4e2a\u5143\u7d20\u8f6c\u6362\u4e3a\u65b0\u5143\u7d20\uff0c\u4ece\u800c\u751f\u6210\u65b0\u6570\u7ec4\u800c\u4e0d\u4fee\u6539\u539f\u59cb\u6570\u7ec4\u3002 \u8bed\u6cd5 let newarray = array.map(function callback(currentvalue, index, array) { \/\/ return element for newarray }, thisarg); \u6216\u8005\uff0c\u4f7f\u7528\u7bad\u5934\u51fd\u6570\uff1a let newarray = array.map((currentvalue, index, array) =&gt; { \/\/ return element for newarray }); \u53c2\u6570 callback\uff1a\u751f\u6210\u65b0\u6570\u7ec4\u5143\u7d20\u7684\u51fd\u6570\uff0c\u91c7\u7528\u4e09\u4e2a\u53c2\u6570\uff1a currentvalue\uff1a\u5f53\u524d\u6b63\u5728\u5904\u7406\u7684\u5143\u7d20\u3002 index \uff08\u53ef\u9009\uff09\uff1a\u5f53\u524d\u5143\u7d20\u7684\u7d22\u5f15\u3002 \u6570\u7ec4 \uff08\u53ef\u9009\uff09\uff1a\u8c03\u7528\u4e86\u6570\u7ec4\u6620\u5c04\u3002 thisarg \uff08\u53ef\u9009\uff09\uff1a\u6267\u884c\u56de\u8c03\u65f6\u7528\u4f5c this [&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-52043","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52043","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=52043"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52043\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52043"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52043"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}