{"id":470,"date":"2025-12-05T10:22:03","date_gmt":"2025-12-05T02:22:03","guid":{"rendered":"https:\/\/www.52runoob.com\/?p=470"},"modified":"2025-12-05T10:22:03","modified_gmt":"2025-12-05T02:22:03","slug":"javascript%e4%b8%ad%e7%9a%84set%e4%b8%8emap%e6%95%b0%e6%8d%ae%e7%bb%93%e6%9e%84%e6%b7%b1%e5%85%a5%e5%af%b9%e6%af%94%e5%88%86%e6%9e%90%e6%a0%b8%e5%bf%83%e7%89%b9%e5%be%81","status":"publish","type":"post","link":"https:\/\/www.52runoob.com\/index.php\/2025\/12\/05\/javascript%e4%b8%ad%e7%9a%84set%e4%b8%8emap%e6%95%b0%e6%8d%ae%e7%bb%93%e6%9e%84%e6%b7%b1%e5%85%a5%e5%af%b9%e6%af%94%e5%88%86%e6%9e%90%e6%a0%b8%e5%bf%83%e7%89%b9%e5%be%81\/","title":{"rendered":"JavaScript\u4e2d\u7684Set\u4e0eMap\u6570\u636e\u7ed3\u6784\u6df1\u5165\u5bf9\u6bd4\u5206\u6790(\u6838\u5fc3\u7279\u5f81)"},"content":{"rendered":"\n<p>\u4e0b\u9762\u7ed9\u4f60\u4e00\u4efd <strong>JavaScript \u4e2d Set \u4e0e Map \u7684\u6df1\u5165\u5bf9\u6bd4\u5206\u6790\uff08\u6838\u5fc3\u7279\u5f81\u7248\uff09<\/strong>\uff0c\u5305\u542b\u5e95\u5c42\u673a\u5236\u3001\u4f7f\u7528\u573a\u666f\u3001\u6027\u80fd\u5dee\u5f02\u4e0e\u5178\u578b\u9677\u9631\uff0c\u662f\u9762\u8bd5\u7ea7\u522b\u3001\u5de5\u7a0b\u5b9e\u8df5\u53ef\u76f4\u63a5\u5f15\u7528\u7684\u8bb2\u89e3\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udd25 JavaScript \u7684 <strong>Set<\/strong> \u4e0e <strong>Map<\/strong> \u6df1\u5ea6\u5bf9\u6bd4\uff08\u6838\u5fc3\u7279\u5f81\uff09<\/h1>\n\n\n\n<p>JS \u5728 ES6 \u5f15\u5165\u4e86\u4e24\u4e2a\u65b0\u7684\u53ef\u8fed\u4ee3\u96c6\u5408\u7c7b\u578b\uff1a<br><strong>Set<\/strong>\uff08\u96c6\u5408\uff09<br><strong>Map<\/strong>\uff08\u952e\u503c\u6620\u5c04\uff09<br>\u5b83\u4eec\u4e0e\u4f20\u7edf\u7684 Object\u3001Array \u6709\u672c\u8d28\u5dee\u5f02\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udccc \u4e00\u3001Set \u7684\u6838\u5fc3\u7279\u5f81\uff08Collection \u7c7b\u578b\uff09<\/h1>\n\n\n\n<p>Set \u662f\u4e00\u79cd <strong>\u4e0d\u5141\u8bb8\u91cd\u590d\u5143\u7d20<\/strong> \u7684\u96c6\u5408\u7ed3\u6784\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1\ufe0f\u20e3 \u4e3b\u8981\u7279\u5f81<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u7279\u6027<\/th><th>\u5185\u5bb9<\/th><\/tr><\/thead><tbody><tr><td>\u5143\u7d20\u552f\u4e00\u6027<\/td><td>\u81ea\u52a8\u53bb\u91cd\uff08\u57fa\u4e8e SameValueZero\uff09<\/td><\/tr><tr><td>\u53ef\u8fed\u4ee3\u6027<\/td><td>\u53ef\u4f7f\u7528 for\u2026of\u3001\u6269\u5c55\u7b26<\/td><\/tr><tr><td>\u5143\u7d20\u65e0\u5e8f<\/td><td>\u63d2\u5165\u987a\u5e8f\u88ab\u8bb0\u5f55\uff0c\u4f46\u65e0\u201c\u7d22\u5f15\u201d<\/td><\/tr><tr><td>\u652f\u6301\u4efb\u610f\u7c7b\u578b<\/td><td>\u5404\u79cd\u539f\u59cb\u503c &amp; \u5bf9\u8c61\u5f15\u7528<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">2\ufe0f\u20e3 \u5e95\u5c42\u89c4\u5219\uff1aSameValueZero<\/h2>\n\n\n\n<p>Set \u5224\u65ad\u5143\u7d20\u662f\u5426\u76f8\u7b49\uff0c\u4f7f\u7528 <strong>SameValueZero<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7c7b\u4f3c <code>===<\/code><\/li>\n\n\n\n<li><strong>+0 \u4e0e -0 \u88ab\u89c6\u4e3a\u76f8\u7b49<\/strong><\/li>\n\n\n\n<li><strong>NaN \u4e0e NaN \u89c6\u4e3a\u76f8\u7b49\uff08\u8fd9\u662f Array.indexOf \u505a\u4e0d\u5230\u7684\uff09<\/strong><\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nnew Set(&#x5B;NaN, NaN]); \/\/ \u53ea\u6709\u4e00\u4e2a NaN\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">3\ufe0f\u20e3 \u5e38\u7528 API<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nadd(value)\ndelete(value)\nhas(value)\nclear()\nsize\n\n<\/pre><\/div>\n\n\n<p>\u904d\u5386\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfor (const v of set) {}\nset.forEach((v) =&gt; {})\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">4\ufe0f\u20e3 \u5178\u578b\u573a\u666f<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6570\u7ec4\u53bb\u91cd <code>new Set(arr)<\/code><\/li>\n\n\n\n<li>\u5224\u65ad\u5143\u7d20\u662f\u5426\u5b58\u5728\uff08\u6bd4 Array.includes \u5feb\uff09<\/li>\n\n\n\n<li>\u5e76\u96c6 \/ \u4ea4\u96c6 \/ \u5dee\u96c6<\/li>\n\n\n\n<li>\u8bb0\u5f55\u552f\u4e00\u5bf9\u8c61\u5f15\u7528<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udccc \u4e8c\u3001Map \u7684\u6838\u5fc3\u7279\u5f81\uff08Dictionary \u7c7b\u578b\uff09<\/h1>\n\n\n\n<p>Map \u662f<strong>\u771f\u6b63\u610f\u4e49\u4e0a\u7684\u54c8\u5e0c\u6620\u5c04<\/strong>\uff08Object \u7684\u5347\u7ea7\u7248\uff09\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1\ufe0f\u20e3 \u4e3b\u8981\u7279\u5f81<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u7279\u6027<\/th><th>\u5185\u5bb9<\/th><\/tr><\/thead><tbody><tr><td>\u952e\u503c\u5bf9\u5b58\u50a8<\/td><td>key \u2192 value<\/td><\/tr><tr><td>key \u53ef\u4e3a\u4efb\u610f\u7c7b\u578b<\/td><td>\u5305\u542b\u5bf9\u8c61\u3001\u51fd\u6570\u3001NaN<\/td><\/tr><tr><td>\u8fed\u4ee3\u987a\u5e8f\u56fa\u5b9a<\/td><td>\u6309\u63d2\u5165\u987a\u5e8f<\/td><\/tr><tr><td>\u66f4\u5feb<\/td><td>\u4e13\u4e3a\u9891\u7e41 set\/get \u8bbe\u8ba1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">2\ufe0f\u20e3 Map \u4e0e SameValueZero<\/h2>\n\n\n\n<p>Map \u6bd4\u8f83 key \u65f6\u4e5f\u4f7f\u7528 <strong>SameValueZero<\/strong>\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nconst map = new Map();\nmap.set(NaN, &#039;x&#039;);\nmap.get(NaN); \/\/ &#039;x&#039;\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">3\ufe0f\u20e3 \u5e38\u7528 API<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nset(key, value)\nget(key)\nhas(key)\ndelete(key)\nclear()\nsize\n\n<\/pre><\/div>\n\n\n<p>\u904d\u5386\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfor (const &#x5B;k, v] of map) {}\nmap.forEach((v, k) =&gt; {})\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">4\ufe0f\u20e3 \u5178\u578b\u573a\u666f<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b58\u50a8\u5927\u91cf\u952e\u503c\u5bf9<\/li>\n\n\n\n<li>key \u4e0d\u662f\u5b57\u7b26\u4e32\u7684\u60c5\u51b5\uff08\u5bf9\u8c61 \u2192 \u6570\u636e\uff09<\/li>\n\n\n\n<li>\u5b9e\u73b0 LRU Cache\uff08\u56e0\u4e3a\u4fdd\u6301\u63d2\u5165\u987a\u5e8f\uff09<\/li>\n\n\n\n<li>\u7edf\u8ba1\u9891\u6b21\uff08\u6bd4\u5982\u8bcd\u9891\u7edf\u8ba1\uff09<\/li>\n\n\n\n<li>WeakMap \u914d\u5408\u79c1\u6709\u5c5e\u6027\u5c01\u88c5<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udccc \u4e09\u3001Set vs Map\uff1a\u6838\u5fc3\u5dee\u5f02\u603b\u7ed3<\/h1>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u9879\u76ee<\/th><th><strong>Set<\/strong><\/th><th><strong>Map<\/strong><\/th><\/tr><\/thead><tbody><tr><td>\u6570\u636e\u7ed3\u6784\u7c7b\u578b<\/td><td>\u96c6\u5408\uff08\u503c \u2192 \u503c\uff09<\/td><td>\u5b57\u5178\uff08key \u2192 value\uff09<\/td><\/tr><tr><td>\u4e3b\u8981\u7528\u9014<\/td><td>\u53bb\u91cd\u3001\u96c6\u5408\u8fd0\u7b97<\/td><td>\u952e\u503c\u5b58\u50a8\u3001\u9ad8\u6027\u80fd\u67e5\u8be2<\/td><\/tr><tr><td>\u5141\u8bb8\u91cd\u590d<\/td><td>\u274c \u4e0d\u5141\u8bb8<\/td><td>\u2714\ufe0f key \u4e0d\u91cd\u590d\uff0c\u4f46 value \u53ef\u91cd\u590d<\/td><\/tr><tr><td>key \u7c7b\u578b<\/td><td>\u65e0 key\uff0c\u5143\u7d20\u5373 value<\/td><td>\u4efb\u610f\u7c7b\u578b\uff08\u91cd\u70b9\uff01\uff09<\/td><\/tr><tr><td>\u662f\u5426\u6709\u7d22\u5f15<\/td><td>\u274c<\/td><td>\u274c\uff08\u4f46\u80fd\u4fdd\u6301\u63d2\u5165\u987a\u5e8f\uff09<\/td><\/tr><tr><td>\u6027\u80fd<\/td><td>\u67e5\u627e\u6bd4 Array \u5feb<\/td><td>\u67e5\u627e\/\u63d2\u5165\u6700\u5feb\uff08\u7ed3\u6784\u5316\uff09<\/td><\/tr><tr><td>\u6700\u4f73\u573a\u666f<\/td><td>\u53bb\u91cd\u3001\u5b58\u5728\u6027\u5224\u65ad<\/td><td>\u54c8\u5e0c\u8868\u3001\u7f13\u5b58\u3001\u5bf9\u8c61\u6620\u5c04<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udccc \u56db\u3001Set \u4e0e Map \u7684\u5e95\u5c42\u5b9e\u73b0\u5dee\u5f02\uff08\u6df1\u5165\u7406\u89e3\uff09<\/h1>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u9879\u76ee<\/th><th>Set<\/th><th>Map<\/th><\/tr><\/thead><tbody><tr><td>\u5185\u90e8\u5b58\u50a8<\/td><td>\u54c8\u5e0c\u8868\uff08\u53ea\u5b58 value\uff09<\/td><td>\u54c8\u5e0c\u8868\uff08key \u2192 value\uff09<\/td><\/tr><tr><td>\u91cd\u590d\u5224\u65ad\u65b9\u5f0f<\/td><td>SameValueZero<\/td><td>SameValueZero<\/td><\/tr><tr><td>\u904d\u5386\u987a\u5e8f<\/td><td>\u6309\u63d2\u5165\u987a\u5e8f<\/td><td>\u6309\u63d2\u5165\u987a\u5e8f<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u4e24\u8005\u5e95\u5c42\u90fd\u57fa\u4e8e <strong>\u54c8\u5e0c\u7ed3\u6784<\/strong>\uff0c\u533a\u522b\u662f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Set<\/strong> \u5b58 \u201c\u503c\u201d<\/li>\n\n\n\n<li><strong>Map<\/strong> \u5b58 \u201c\u952e \u2192 \u503c\u201d<\/li>\n<\/ul>\n\n\n\n<p>\u56e0\u6b64 Map \u7684\u5185\u5b58\u5360\u7528\u66f4\u5927\uff0c\u4f46\u529f\u80fd\u66f4\u5f3a\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udccc \u4e94\u3001\u54ea\u4e9b\u5730\u65b9 Set\/Map \u660e\u663e\u6bd4 Array\/Object \u66f4\u6709\u4f18\u52bf\uff1f<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">1\ufe0f\u20e3 \u53bb\u91cd\uff08Set\uff09<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nconst unique = &#x5B;...new Set(arr)];\n\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">2\ufe0f\u20e3 \u9891\u6b21\u7edf\u8ba1\uff08Map \u6bd4 Object \u66f4\u4f18\uff09<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nconst freq = new Map();\nfor (const c of str) {\n  freq.set(c, (freq.get(c) || 0) + 1);\n}\n\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">3\ufe0f\u20e3 \u5224\u65ad\u662f\u5426\u5b58\u5728\uff08Set\uff09<\/h2>\n\n\n\n<p>\u6bd4\u6570\u7ec4 includes \u7684 O(n) \u5feb\u5f97\u591a\uff08Set \u662f O(1)\uff09<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4\ufe0f\u20e3 key \u662f\u5bf9\u8c61\uff08Object \u505a\u4e0d\u5230\uff09<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nconst map = new Map();\nconst btn = document.querySelector(&#039;button&#039;);\nmap.set(btn, &#039;clicked&#039;);\n\n<\/pre><\/div>\n\n\n<p>Object \u53ea\u80fd\u7528\u5b57\u7b26\u4e32\u4f5c\u4e3a key\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udccc \u516d\u3001\u5178\u578b\u9677\u9631\u4e0e\u8bef\u533a<\/h1>\n\n\n\n<h3 class=\"wp-block-heading\">\u27571. Set \u4e0d\u4f1a\u6df1\u5ea6\u6bd4\u8f83\u5bf9\u8c61<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nnew Set(&#x5B;{a:1}, {a:1}]).size \/\/ = 2\n\n<\/pre><\/div>\n\n\n<p>\u56e0\u4e3a\u5bf9\u8c61\u5f15\u7528\u4e0d\u540c\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u27572. Map \u548c Object \u6df7\u7528\u65f6\u53ef\u80fd\u5bfc\u81f4 key \u6d88\u5931<\/h3>\n\n\n\n<p>Object \u6ca1\u8bc6\u522b\u5bf9\u8c61 key\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nconst obj = {};\nobj&#x5B;{a:1}] = 123;\nconsole.log(obj); \/\/ &quot;&#x5B;object Object]&quot;: 123\n\n<\/pre><\/div>\n\n\n<p>Map \u4e0d\u4f1a\u53d1\u751f\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nconst map = new Map();\nmap.set({a:1}, 123);\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u27573. JSON \u65e0\u6cd5\u5e8f\u5217\u5316 Map \/ Set<\/h3>\n\n\n\n<p>\u5fc5\u987b\u8f6c\u6362\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nJSON.stringify(&#x5B;...map]);\nJSON.stringify(&#x5B;...set]);\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udccc \u4e03\u3001\u6781\u7b80\u7248\u901f\u67e5\u8868\uff08\u9762\u8bd5\u7ecf\u5178\uff09<\/h1>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u9700\u6c42<\/th><th>\u9009\u54ea\u4e2a\uff1f<\/th><\/tr><\/thead><tbody><tr><td>\u6570\u7ec4\u53bb\u91cd<\/td><td>Set<\/td><\/tr><tr><td>\u9ad8\u6548 key-value<\/td><td>Map<\/td><\/tr><tr><td>key \u53ef\u4ee5\u662f\u5bf9\u8c61<\/td><td>Map<\/td><\/tr><tr><td>\u5224\u65ad\u5143\u7d20\u5b58\u5728<\/td><td>Set<\/td><\/tr><tr><td>\u505a\u7f13\u5b58\uff08LRU\uff09<\/td><td>Map<\/td><\/tr><tr><td>\u505a\u6570\u5b66\u96c6\u5408\u8fd0\u7b97<\/td><td>Set<\/td><\/tr><tr><td>\u66ff\u4ee3 Object \u505a\u914d\u7f6e\u8868<\/td><td>Map\uff08\u66f4\u4f18\uff09<\/td><\/tr><tr><td>\u904d\u5386\u987a\u5e8f\u56fa\u5b9a<\/td><td>\u4e24\u8005\u90fd\u884c<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u4f60\u9700\u8981\u54ea\u4e00\u90e8\u5206\uff1f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0b\u9762\u7ed9\u4f60\u4e00\u4efd JavaScript \u4e2d Set \u4e0e Map \u7684\u6df1\u5165\u5bf9\u6bd4\u5206\u6790\uff08\u6838\u5fc3&#8230; <a class=\"more-link\" href=\"https:\/\/www.52runoob.com\/index.php\/2025\/12\/05\/javascript%e4%b8%ad%e7%9a%84set%e4%b8%8emap%e6%95%b0%e6%8d%ae%e7%bb%93%e6%9e%84%e6%b7%b1%e5%85%a5%e5%af%b9%e6%af%94%e5%88%86%e6%9e%90%e6%a0%b8%e5%bf%83%e7%89%b9%e5%be%81\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[],"class_list":["post-470","post","type-post","status-publish","format-standard","hentry","category-javascript"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/comments?post=470"}],"version-history":[{"count":1,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/470\/revisions"}],"predecessor-version":[{"id":471,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/470\/revisions\/471"}],"wp:attachment":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/media?parent=470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/categories?post=470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/tags?post=470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}