{"id":166045,"date":"2024-05-08T15:28:31","date_gmt":"2024-05-08T07:28:31","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/166045.html"},"modified":"2024-05-08T15:28:35","modified_gmt":"2024-05-08T07:28:35","slug":"javascript%e4%b8%ad%e7%9a%84-reduce-%e6%96%b9%e6%b3%95%e6%9c%89%e5%93%aa%e4%ba%9b%e5%ba%94%e7%94%a8%e5%9c%ba%e6%99%af","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/166045.html","title":{"rendered":"javascript\u4e2d\u7684 reduce \u65b9\u6cd5\u6709\u54ea\u4e9b\u5e94\u7528\u573a\u666f"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/26233105\/119e9157-2148-4e91-b019-30937b1c4689.webp\" alt=\"javascript\u4e2d\u7684 reduce \u65b9\u6cd5\u6709\u54ea\u4e9b\u5e94\u7528\u573a\u666f\" \/><\/p>\n<p><p>\u51cf\u5c11\u65b9\u6cd5\uff08reduce\uff09\u5728JavaScript\u4e2d\u662f\u4e00\u4e2a\u591a\u529f\u80fd\u4e14\u5f3a\u5927\u7684\u6570\u7ec4\u65b9\u6cd5\u3002\u5b83\u7684\u5e94\u7528\u573a\u666f\u5305\u62ec<strong>\u7d2f\u79ef\u6570\u636e\u3001\u6570\u7ec4\u8f6c\u6362\u3001\u6570\u636e\u63d0\u53d6\u3001\u7ba1\u9053\u51fd\u6570<\/strong>\u7b49\u3002<strong>\u7d2f\u79ef\u6570\u636e<\/strong>\u662freduce\u65b9\u6cd5\u6700\u76f4\u89c2\u7684\u5e94\u7528\uff0c\u6211\u4eec\u53ef\u4ee5\u5229\u7528\u5b83\u6765\u8ba1\u7b97\u6570\u7ec4\u4e2d\u6240\u6709\u5143\u7d20\u7684\u548c\u3001\u4e58\u79ef\u6216\u8005\u5176\u5b83\u5f62\u5f0f\u7684\u6c47\u603b\u6570\u636e\u3002<\/p>\n<\/p>\n<p><p><strong>\u7d2f\u79ef\u6570\u636e<\/strong>\u5141\u8bb8\u6211\u4eec\u5c06\u4e00\u4e2a\u6570\u7ec4\u7684\u6240\u6709\u5143\u7d20\u7ec4\u5408\u6210\u4e00\u4e2a\u5355\u4e00\u7684\u8f93\u51fa\u503c\uff0c\u6bd4\u5982\u8fdb\u884c\u6c42\u548c\u64cd\u4f5c\u3002\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u5982\u679c\u6709\u4e00\u4e2a\u6570\u5b57\u6570\u7ec4\uff0c\u6211\u4eec\u60f3\u8981\u8ba1\u7b97\u8fd9\u4e9b\u6570\u5b57\u7684\u603b\u548c\uff0creduce\u65b9\u6cd5\u5141\u8bb8\u6211\u4eec\u7528\u7d27\u51d1\u7684\u4ee3\u7801\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002\u901a\u8fc7\u6761\u7528reduce\u5e76\u63d0\u4f9b\u4e00\u4e2a\u56de\u8c03\u51fd\u6570\uff0c\u6307\u660e\u5982\u4f55\u5904\u7406\u6bcf\u4e2a\u5143\u7d20\u4e0e\u7d2f\u8ba1\u5668\u4e4b\u95f4\u7684\u64cd\u4f5c\uff0c\u4ee5\u53ca\u521d\u59cb\u7684\u7d2f\u8ba1\u5668\u503c\uff0c\u5c31\u53ef\u4ee5\u5f97\u5230\u6574\u4e2a\u6570\u7ec4\u5143\u7d20\u7684\u7d2f\u52a0\u7ed3\u679c\u3002<\/p>\n<\/p>\n<hr>\n<p><h3>\u4e00\u3001\u7d2f\u79ef\u6570\u7ec4\u4e2d\u7684\u503c<\/h3>\n<\/p>\n<p><p>\u5728\u5f88\u591a\u7f16\u7a0b\u573a\u666f\u4e2d\uff0c\u6211\u4eec\u4f1a\u9047\u5230\u9700\u8981\u5bf9\u6570\u7ec4\u4e2d\u6240\u6709\u9879\u7684\u503c\u8fdb\u884c\u7d2f\u79ef\u64cd\u4f5c\u7684\u9700\u6c42\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u5bf9\u4e00\u7cfb\u5217\u7684\u6570\u5b57\u8fdb\u884c\u6c42\u548c\u3001\u6c42\u4e58\u79ef\u3001\u6216\u8005\u5176\u4ed6\u4efb\u4f55\u5f62\u5f0f\u7684\u5f52\u7eb3\u7edf\u8ba1\u3002<\/p>\n<\/p>\n<p><h4>\u6c42\u548c<\/h4>\n<\/p>\n<p><p>\u6700\u5e38\u89c1\u7684\u4e00\u4e2a\u4f8b\u5b50\u662f\u4f7f\u7528reduce\u6765\u8ba1\u7b97\u4e00\u4e2a\u6570\u503c\u6570\u7ec4\u4e2d\u6240\u6709\u6570\u7684\u603b\u548c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-javascript\">const numbers = [1, 2, 3, 4, 5];<\/p>\n<p>const sum = numbers.reduce((accumulator, currentValue) =&gt; accumulator + currentValue, 0);<\/p>\n<p>console.log(sum); \/\/ \u8f93\u51fa15<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>\u6c42\u4e58\u79ef<\/h4>\n<\/p>\n<p><p>\u540c\u6837\u7684\uff0c\u6211\u4eec\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u5c06\u6c42\u548c\u6539\u4e3a\u6c42\u4e58\u79ef\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-javascript\">const product = numbers.reduce((accumulator, currentValue) =&gt; accumulator * currentValue, 1);<\/p>\n<p>console.log(product); \/\/ \u8f93\u51fa120<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u6570\u7ec4\u8f6c\u6362<\/h3>\n<\/p>\n<p><p>reduce\u65b9\u6cd5\u5728\u5904\u7406\u8f6c\u6362\u6570\u7ec4\u65f6\u4e5f\u5341\u5206\u6709\u7528\uff0c\u53ef\u4ee5\u5c06\u6570\u7ec4\u8f6c\u6362\u4e3a\u51e0\u4e4e\u4efb\u4f55\u5176\u4ed6\u7c7b\u578b\u7684\u6570\u636e\u7ed3\u6784\u3002<\/p>\n<\/p>\n<p><h4>\u5bf9\u8c61\u8f6c\u6362<\/h4>\n<\/p>\n<p><p>\u5c06\u4e00\u4e2a\u5305\u542b\u591a\u4e2a\u5c5e\u6027\u7684\u5bf9\u8c61\u6570\u7ec4\u8f6c\u6362\u4e3a\u4ee5\u8fd9\u4e9b\u5c5e\u6027\u4e3a\u952e\u3001\u5bf9\u5e94\u503c\u4e3a\u503c\u7684\u5355\u4e00\u5bf9\u8c61\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-javascript\">const people = [<\/p>\n<p>  { name: &quot;Alice&quot;, age: 21 },<\/p>\n<p>  { name: &quot;Bob&quot;, age: 22 },<\/p>\n<p>  { name: &quot;Charlie&quot;, age: 23 }<\/p>\n<p>];<\/p>\n<p>const peopleObject = people.reduce((accumulator, currentValue) =&gt; {<\/p>\n<p>  accumulator[currentValue.name] = currentValue.age;<\/p>\n<p>  return accumulator;<\/p>\n<p>}, {});<\/p>\n<p>console.log(peopleObject); \/\/ \u8f93\u51fa{ Alice: 21, Bob: 22, Charlie: 23 }<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>\u6570\u7ec4\u6241\u5e73\u5316<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528reduce\u5bf9\u591a\u7ef4\u6570\u7ec4\u8fdb\u884c\u6241\u5e73\u5316\u5904\u7406\uff0c\u5c06\u591a\u5c42\u5d4c\u5957\u6570\u7ec4\u8f6c\u6362\u4e3a\u5355\u4e00\u7ef4\u5ea6\u6570\u7ec4\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-javascript\">const nestedArray = [1, [2, [3, [4]], 5]];<\/p>\n<p>const flatArray = nestedArray.reduce((accumulator, currentValue) =&gt; accumulator.concat(Array.isArray(currentValue) ? currentValue.reduce((acc, cur) =&gt; acc.concat(cur), []) : currentValue), []);<\/p>\n<p>console.log(flatArray); \/\/ \u8f93\u51fa[1, 2, 3, 4, 5]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u6570\u636e\u63d0\u53d6<\/h3>\n<\/p>\n<p><p>\u5f53\u5904\u7406\u5bf9\u8c61\u6570\u7ec4\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528reduce\u65b9\u6cd5\u6765\u63d0\u53d6\u5e76\u64cd\u4f5c\u7279\u5b9a\u7684\u6570\u636e\u3002<\/p>\n<\/p>\n<p><h4>\u63d0\u53d6\u5e76\u7edf\u8ba1\u5c5e\u6027<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u60f3\u8981\u7edf\u8ba1\u4e00\u4e2a\u5bf9\u8c61\u6570\u7ec4\u4e2d\u67d0\u4e2a\u5c5e\u6027\u503c\u51fa\u73b0\u7684\u6b21\u6570\uff0creduce\u975e\u5e38\u9002\u5408\u5b8c\u6210\u8fd9\u9879\u4efb\u52a1\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-javascript\">const fruits = [<\/p>\n<p>  { type: &quot;apple&quot; }, <\/p>\n<p>  { type: &quot;banana&quot; }, <\/p>\n<p>  { type: &quot;orange&quot; }, <\/p>\n<p>  { type: &quot;apple&quot; }<\/p>\n<p>];<\/p>\n<p>const fruitCounts = fruits.reduce((accumulator, currentValue) =&gt; {<\/p>\n<p>  accumulator[currentValue.type] = (accumulator[currentValue.type] || 0) + 1;<\/p>\n<p>  return accumulator;<\/p>\n<p>}, {});<\/p>\n<p>console.log(fruitCounts); \/\/ \u8f93\u51fa{ apple: 2, banana: 1, orange: 1 }<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>\u8fc7\u6ee4\u5e76\u63d0\u53d6\u7279\u5b9a\u6570\u636e<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7\u7ed3\u5408filter\u548creduce\uff0c\u6211\u4eec\u53ef\u4ee5\u5148\u8fc7\u6ee4\u6570\u7ec4\uff0c\u7136\u540e\u4f7f\u7528reduce\u628a\u8fc7\u6ee4\u540e\u7684\u7ed3\u679c\u8fdb\u884c\u8fdb\u4e00\u6b65\u7684\u5904\u7406\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-javascript\">const data = [<\/p>\n<p>  { id: 1, name: &#039;John&#039;, age: 24 },<\/p>\n<p>  { id: 2, name: &#039;Jane&#039;, age: 22 },<\/p>\n<p>  { id: 3, name: &#039;Jack&#039;, age: 25 }<\/p>\n<p>];<\/p>\n<p>const over23 = data.filter(person =&gt; person.age &gt; 23)<\/p>\n<p>                   .reduce((accumulator, currentValue) =&gt; {<\/p>\n<p>                     accumulator.push(currentValue.name);<\/p>\n<p>                     return accumulator;<\/p>\n<p>                   }, []);<\/p>\n<p>console.log(over23); \/\/ \u8f93\u51fa[&quot;John&quot;, &quot;Jack&quot;]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u7ba1\u9053\u51fd\u6570\uff08Function Composition\uff09<\/h3>\n<\/p>\n<p><p>reduce\u53ef\u4ee5\u88ab\u7528\u6765\u4e32\u8054\u6267\u884c\u4e00\u7cfb\u5217\u7684\u51fd\u6570\uff0c\u8fd9\u5728\u7ba1\u9053\u5904\u7406\u6216\u51fd\u6570\u7ec4\u5408\u65f6\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><h4>\u7ec4\u5408\u51fd\u6570<\/h4>\n<\/p>\n<p><pre><code class=\"language-javascript\">const increment = input =&gt; input + 1;<\/p>\n<p>const double = input =&gt; input * 2;<\/p>\n<p>const square = input =&gt; input * input;<\/p>\n<p>const functions = [increment, double, square];<\/p>\n<p>const initialValue = 2;<\/p>\n<p>const result = functions.reduce((accumulator, func) =&gt; func(accumulator), initialValue);<\/p>\n<p>console.log(result); \/\/ \u8f93\u51fa36, \u5373\u51482+1, \u518d3*2, \u6700\u540e6\u7684\u5e73\u65b9<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u6b64\u573a\u666f\u4e0b\uff0creduce\u4f9d\u6b21\u5e94\u7528\u6bcf\u4e2a\u51fd\u6570\u5230\u7d2f\u8ba1\u5668\u4e0a\uff0c\u6bcf\u4e2a\u51fd\u6570\u7684\u8f93\u51fa\u662f\u4e0b\u4e00\u4e2a\u51fd\u6570\u7684\u8f93\u5165\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u66f4\u9ad8\u7ea7\u7684\u5e94\u7528<\/h3>\n<\/p>\n<p><h4>\u72b6\u6001\u673a<\/h4>\n<\/p>\n<p><p>reduce\u53ef\u4ee5\u5904\u7406\u72b6\u6001\u8f6c\u6362\uff0c\u5b83\u53ef\u4ee5\u7ba1\u7406\u72b6\u6001\u7684\u6539\u53d8\u8fc7\u7a0b\uff0c\u4f7f\u4ee3\u7801\u5b9e\u73b0\u53d8\u5f97\u4f18\u96c5\u3002<\/p>\n<\/p>\n<p><h4>\u52a8\u6001\u51fd\u6570\u8c03\u7528<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u4f7f\u7528reduce\u6839\u636e\u4f20\u5165\u53c2\u6570\u52a8\u6001\u5730\u6784\u9020\u51fd\u6570\u8c03\u7528\u94fe\uff0c\u5b9e\u73b0\u57fa\u4e8e\u6761\u4ef6\u7684\u590d\u6742\u64cd\u4f5c\u6d41\u7a0b\u8bbe\u8ba1\u3002<\/p>\n<\/p>\n<p><p>JavaScript\u4e2d\u7684reduce\u65b9\u6cd5\u7531\u4e8e\u5176\u5f3a\u5927\u7684\u529f\u80fd\u4e0e\u7075\u6d3b\u6027\uff0c\u5728\u65e5\u5e38\u7f16\u7a0b\u548c\u7b97\u6cd5\u5b9e\u73b0\u4e2d\u6709\u5e7f\u6cdb\u7684\u8fd0\u7528\u573a\u666f\u3002\u65e0\u8bba\u662f\u7b80\u5355\u7684\u6570\u7ec4\u7d2f\u8ba1\u64cd\u4f5c\uff0c\u8fd8\u662f\u590d\u6742\u7684\u6570\u636e\u7ed3\u6784\u8f6c\u6362\u3001\u5c5e\u6027\u63d0\u53d6\uff0c\u4e43\u81f3\u4e8e\u51fd\u6570\u5f0f\u7f16\u7a0b\u4e2d\u7684\u7ba1\u9053\u548c\u7ec4\u5408\u64cd\u4f5c\uff0creduce\u51e0\u4e4e\u90fd\u80fd\u627e\u5230\u5b83\u7684\u8eab\u5f71\u3002\u5b66\u4f1a\u8fd0\u7528reduce\uff0c\u5c06\u6709\u52a9\u4e8e\u63d0\u9ad8JavaScript\u4ee3\u7801\u7684\u8868\u73b0\u529b\u548c\u6548\u7387\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>Q: \u4ec0\u4e48\u662fJavascript\u4e2d\u7684reduce\u65b9\u6cd5\uff1f<\/strong><\/p>\n<p>A: Javascript\u4e2d\u7684reduce\u65b9\u6cd5\u662f\u4e00\u4e2a\u9ad8\u9636\u51fd\u6570\uff0c\u5b83\u53ef\u4ee5\u5c06\u4e00\u4e2a\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u901a\u8fc7\u6307\u5b9a\u7684\u5904\u7406\u51fd\u6570\u8fdb\u884c\u7d2f\u79ef\u8ba1\u7b97\uff0c\u6700\u7ec8\u8fd4\u56de\u4e00\u4e2a\u503c\u3002reduce\u65b9\u6cd5\u63a5\u6536\u4e24\u4e2a\u53c2\u6570\uff0c\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f\u5904\u7406\u51fd\u6570\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f\u521d\u59cb\u503c\u3002\u5904\u7406\u51fd\u6570\u53ef\u4ee5\u63a5\u6536\u56db\u4e2a\u53c2\u6570\uff1a\u7d2f\u52a0\u5668\uff0c\u5f53\u524d\u503c\uff0c\u5f53\u524d\u7d22\u5f15\u548c\u539f\u59cb\u6570\u7ec4\u3002\u901a\u8fc7\u5728\u5904\u7406\u51fd\u6570\u4e2d\u9010\u6b65\u7d2f\u52a0\u5904\u7406\u6570\u7ec4\u7684\u5143\u7d20\uff0c\u6211\u4eec\u53ef\u4ee5\u5b9e\u73b0\u5404\u79cd\u5e94\u7528\u573a\u666f\u3002<\/p>\n<p><strong>Q: reduce\u65b9\u6cd5\u53ef\u4ee5\u7528\u4e8e\u54ea\u4e9b\u5e94\u7528\u573a\u666f\uff1f<\/strong><\/p>\n<p>A: reduce\u65b9\u6cd5\u53ef\u4ee5\u5e94\u7528\u4e8e\u8bb8\u591a\u4e0d\u540c\u7684\u573a\u666f\u3002\u6bd4\u5982\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528reduce\u65b9\u6cd5\u6765\u5b9e\u73b0\u5bf9\u6570\u7ec4\u4e2d\u7684\u6570\u5b57\u6c42\u548c\u3001\u627e\u5230\u6570\u7ec4\u4e2d\u7684\u6700\u5927\u503c\u3001\u7edf\u8ba1\u6570\u7ec4\u4e2d\u5404\u4e2a\u5143\u7d20\u51fa\u73b0\u7684\u6b21\u6570\u7b49\u3002\u6b64\u5916\uff0creduce\u65b9\u6cd5\u8fd8\u53ef\u4ee5\u7528\u4e8e\u6570\u7ec4\u7684\u6241\u5e73\u5316\u3001\u53bb\u91cd\u548c\u6392\u5e8f\u7b49\u64cd\u4f5c\u3002\u5982\u679c\u5728\u5904\u7406\u51fd\u6570\u4e2d\u7ed3\u5408\u4e00\u4e9b\u6761\u4ef6\u5224\u65ad\u548c\u903b\u8f91\u8fd0\u7b97\uff0creduce\u65b9\u6cd5\u7684\u5e94\u7528\u573a\u666f\u4f1a\u66f4\u52a0\u4e30\u5bcc\u3002<\/p>\n<p><strong>Q: \u5982\u4f55\u6b63\u786e\u4f7f\u7528reduce\u65b9\u6cd5\uff1f<\/strong><\/p>\n<p>A: \u5728\u4f7f\u7528reduce\u65b9\u6cd5\u4e4b\u524d\uff0c\u9700\u8981\u6ce8\u610f\u4e00\u4e9b\u4f7f\u7528\u6280\u5de7\u3002\u9996\u5148\uff0c\u786e\u4fdd\u4f20\u5165\u7684\u5904\u7406\u51fd\u6570\u5177\u6709\u6b63\u786e\u7684\u8fd4\u56de\u503c\uff0c\u4f7f\u5f97\u7d2f\u52a0\u5668\u7684\u503c\u80fd\u591f\u6b63\u786e\u7d2f\u79ef\u3002\u5176\u6b21\uff0c\u4e3areduce\u65b9\u6cd5\u63d0\u4f9b\u4e00\u4e2a\u521d\u59cb\u503c\u662f\u5341\u5206\u91cd\u8981\u7684\uff0c\u5728\u6ca1\u6709\u521d\u59cb\u503c\u7684\u60c5\u51b5\u4e0b\uff0creduce\u65b9\u6cd5\u5c06\u4f7f\u7528\u6570\u7ec4\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u4f5c\u4e3a\u521d\u59cb\u503c\uff0c\u5e76\u4ece\u6570\u7ec4\u7684\u7b2c\u4e8c\u4e2a\u5143\u7d20\u5f00\u59cb\u8fdb\u884c\u7d2f\u79ef\u8ba1\u7b97\u3002\u6700\u540e\uff0c\u5408\u7406\u5229\u7528\u5904\u7406\u51fd\u6570\u4e2d\u7684\u5176\u4ed6\u53c2\u6570\uff0c\u6bd4\u5982\u5f53\u524d\u7d22\u5f15\u548c\u539f\u59cb\u6570\u7ec4\uff0c\u53ef\u4ee5\u589e\u52a0reduce\u65b9\u6cd5\u7684\u7075\u6d3b\u6027\u548c\u5e94\u7528\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u51cf\u5c11\u65b9\u6cd5\uff08reduce\uff09\u5728JavaScript\u4e2d\u662f\u4e00\u4e2a\u591a\u529f\u80fd\u4e14\u5f3a\u5927\u7684\u6570\u7ec4\u65b9\u6cd5\u3002\u5b83\u7684\u5e94\u7528\u573a\u666f\u5305\u62ec\u7d2f\u79ef\u6570\u636e\u3001\u6570\u7ec4\u8f6c [&hellip;]","protected":false},"author":3,"featured_media":166050,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/166045"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=166045"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/166045\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/166050"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=166045"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=166045"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=166045"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}