{"id":52878,"date":"2024-12-03T16:38:30","date_gmt":"2024-12-03T08:38:30","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52878\/"},"modified":"2024-12-03T16:38:30","modified_gmt":"2024-12-03T08:38:30","slug":"array-javascript-challenges-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52878\/","title":{"rendered":"Array &#8211; JavaScript Challenges"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>Array &#8211; JavaScript Challenges<\/h1>\n<p><span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span>    <\/p>\n<p>\u4e00\u5206\u8015\u8018\uff0c\u4e00\u5206\u6536\u83b7\uff01\u65e2\u7136\u90fd\u6253\u5f00\u8fd9\u7bc7<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aArray &#8211; JavaScript Challenges\u300b<\/span>\uff0c\u5c31\u575a\u6301\u770b\u4e0b\u53bb\uff0c\u5b66\u4e0b\u53bb\u5427\uff01\u672c\u6587\u4e3b\u8981\u4f1a\u7ed9\u5927\u5bb6\u8bb2\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u5927\u5bb6\u5bf9\u672c\u6587\u6709\u597d\u7684\u5efa\u8bae\u6216\u8005\u770b\u5230\u6709\u4e0d\u8db3\u4e4b\u5904\uff0c\u975e\u5e38\u6b22\u8fce\u5927\u5bb6\u79ef\u6781\u63d0\u51fa\uff01\u5728\u540e\u7eed\u6587\u7ae0\u6211\u4f1a\u7ee7\u7eed\u66f4\u65b0<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u76f8\u5173\u7684\u5185\u5bb9\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u90fd\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241124\/17324247846742b450c3739.jpg\" class=\"aligncenter\" title=\"Array &#8211; JavaScript Challenges\u63d2\u56fe\" alt=\"Array &#8211; JavaScript Challenges\u63d2\u56fe\" \/><\/p>\n<p>\u60a8\u53ef\u4ee5\u5728 repo github \u4e0a\u627e\u5230\u8fd9\u7bc7\u6587\u7ae0\u4e2d\u7684\u6240\u6709\u4ee3\u7801\u3002<\/p>\n<hr>\n<h2> \u9635\u5217\u76f8\u5173\u7684\u6311\u6218 <\/h2>\n<hr>\n<h3> \u6570\u7ec4 <\/h3>\n<pre>\/**\n * @return {array}\n *\/\n\nfunction arrayof(arr) {\n  return [].slice.call(arguments);\n}\n\n\/\/ usage example\nconst array1 = [1, 2, 3];\nconst array2 = [4, 5, 6];\n\nconst combinedarray = arrayof(array1, array2);\nconsole.log(combinedarray); \/\/ =&gt; [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]\n<\/pre>\n<hr>\n<h3> \u6570\u7ec4\u5230\u6811 <\/h3>\n<pre>\/**\n * @param {array} arr\n * @return {array}\n *\/\n\nfunction arrtotree(arr) {\n  const tree = [];\n  const hashmap = new map();\n\n  \/\/ create nodes and store references\n  arr.foreach((item) =&gt; {\n    hashmap[item.id] = {\n      id: item.id,\n      name: item.name,\n      children: [],\n    };\n  });\n\n  \/\/ build the tree\n  arr.foreach((item) =&gt; {\n    if (item.parentid === null) {\n      tree.push(hashmap[item.id]);\n    } else {\n      hashmap[item.parentid].children.push(hashmap[item.id]);\n    }\n  });\n\n  return tree;\n}\n\n\/\/ usage example\nconst flatarray = [\n  { id: 1, name: \"node 1\", parentid: null },\n  { id: 2, name: \"node 1.1\", parentid: 1 },\n  { id: 3, name: \"node 1.2\", parentid: 1 },\n  { id: 4, name: \"node 1.1.1\", parentid: 2 },\n  { id: 5, name: \"node 2\", parentid: null },\n  { id: 6, name: \"node 2.1\", parentid: 5 },\n  { id: 7, name: \"node 2.2\", parentid: 5 },\n];\n\nconst tree = arrtotree(flatarray);\n\nconsole.log(tree); \/\/ =&gt; [{ id: 1, name: 'node 1', children: [ [object], [object] ] }, { id: 5, name: 'node 2', children: [ [object], [object] ] }]\n<\/pre>\n<hr>\n<h3> \u6570\u7ec4\u5305\u88c5\u5668 <\/h3>\n<pre>class arraywrapper {\n  constructor(arr) {\n    this._arr = arr;\n  }\n\n  valueof() {\n    return this._arr.reduce((sum, num) =&gt; sum + num, 0);\n  }\n\n  tostring() {\n    return `[${this._arr.join(\",\")}]`;\n  }\n}\n\n\/\/ usage example\nconst obj1 = new arraywrapper([1, 2]);\nconst obj2 = new arraywrapper([3, 4]);\nconsole.log(obj1 + obj2); \/\/ =&gt; 10\nconsole.log(string(obj1)); \/\/ =&gt; [1,2]\n<\/pre>\n<hr>\n<h3> \u7c7b\u6570\u7ec4\u5230\u6570\u7ec4 <\/h3>\n<pre>\/**\n * @param {any} arraylike\n * @return {array}\n *\/\n\nfunction arrayliketoarray(arraylike) {\n  return array.from(arraylike);\n}\n\n\/\/ usage example\nconst arraylike = {\n  0: \"a\",\n  1: \"b\",\n  2: \"c\",\n  length: 3,\n};\nconsole.log(arrayliketoarray(arraylike)); \/\/ =&gt; ['a', 'b', 'c']\n<\/pre>\n<hr>\n<h3> \u5757 <\/h3>\n<pre>\/**\n * @template t\n * @param {array&lt;t&gt;} arr the array to process.\n * @param {number} [size=1] the length of each chunk.\n * @returns {array&lt;array&lt;t&gt;&gt;} the new array of chunks.\n *\/\n\nfunction chunk(arr, size = 1) {\n  if (!array.isarray(arr) || size &lt; 1) {\n    return [];\n  }\n\n  const newarray = [];\n\n  for (let i = 0; i &lt; arr.length; i += size) {\n    const chunk = arr.slice(i, i + size);\n    newarray.push(chunk);\n  }\n\n  return newarray;\n}\n\n\/\/ usage example\nconsole.log(chunk([\"a\", \"b\", \"c\", \"d\"])); \/\/ =&gt; [['a'], ['b'], ['c'], ['d']]\nconsole.log(chunk([1, 2, 3, 4], 2)); \/\/ =&gt; [[1, 2], [3, 4]]\nconsole.log(chunk([1, 2, 3, 4], 3)); \/\/ =&gt; [[1, 2, 3], [4]]\n<\/pre>\n<hr>\n<h3> \u7ec4\u5408 <\/h3>\n<pre>\/**\n * @param {array} arrs\n * @return {array}\n *\/\n\nfunction generatecombinations(arrs) {\n  const result = [];\n\n  function backtrack(start, current) {\n    if (start === arrs.length) {\n      result.push(current.join(''));\n      return;\n    }\n\n    for (const item of arrs[start]) {\n      current.push(item);\n      backtrack(start + 1, current);\n      current.pop();\n    }\n  }\n\n  backtrack(0, []);\n\n  return result;\n}\n\n\/\/ usage example\nconst nestedarray = [['a', 'b'], [1, 2], [3, 4]];\nconsole.log(generatecombinations(nestedarray)); \/\/ =&gt; ['a13', 'a14', 'a23', 'a24', 'b13', 'b14', 'b23', 'b24']\n<\/pre>\n<hr>\n<h3> \u4e0d\u540c\u4e4b\u5904 <\/h3>\n<pre>\/**\n * @param {array} array\n * @param {array} values\n * @return {array}\n *\/\n\nfunction difference(arr, values) {\n  const newarray = [];\n  const valueset = new set(values);\n\n  for (let i = 0; i &lt; arr.length; i += 1) {\n    const value = arr[i];\n\n    if (\n      !valueset.has(value) &amp;&amp;\n      !(value === undefined &amp;&amp; !object.hasown(arr, i))\n    ) {\n      newarray.push(value);\n    }\n  }\n\n  return newarray;\n}\n\n\/\/ usage example\nconsole.log(difference([1, 2, 3], [2, 3])); \/\/ =&gt; [1]\nconsole.log(difference([1, 2, 3, 4], [2, 3, 1])); \/\/ =&gt; [4]\nconsole.log(difference([1, 2, 3], [2, 3, 1, 4])); \/\/ =&gt; []\nconsole.log(difference([1, , 3], [1])); \/\/ =&gt; [3]\n<\/pre>\n<hr>\n<h3> \u7acb\u5373\u4e0b\u964d <\/h3>\n<pre>\/**\n * @param {array} array\n * @param {function} predicate\n * @return {array}\n *\/\nfunction droprightwhile(arr, predicate) {\n  let index = arr.length - 1;\n\n  while (index &gt;= 0 &amp;&amp; predicate(arr[index], index, arr)) {\n    index -= 1;\n  }\n\n  return arr.slice(0, index + 1);\n}\n\n\/\/ usage example\nconsole.log(droprightwhile([1, 2, 3, 4, 5], (value) =&gt; value &gt; 3)); \/\/ =&gt; [1, 2, 3]\nconsole.log(droprightwhile([1, 2, 3], (value) =&gt; value &lt; 6)); \/\/ =&gt; []\nconsole.log(droprightwhile([1, 2, 3, 4, 5], (value) =&gt; value &gt; 6)); \/\/ =&gt; [1, 2, 3, 4, 5]\n<\/pre>\n<hr>\n<h3> \u6389\u843d\u65f6 <\/h3>\n<pre>\/**\n * @param {array} array\n * @param {function} predicate\n * @return {array}\n *\/\n\nfunction dropwhile(arr, predicate) {\n  let index = 0;\n\n  while (index &lt; arr.length &amp;&amp; predicate(arr[index], index, arr)) {\n    index += 1;\n  }\n\n  return arr.slice(index);\n}\n\n\/\/ usage example\ndropwhile([1, 2, 3, 4, 5], (value) =&gt; value &lt; 3); \/\/ =&gt; [3, 4, 5]\ndropwhile([1, 2, 3], (value) =&gt; value &lt; 6); \/\/ =&gt; []\n<\/pre>\n<hr>\n<h3> \u5c55\u5e73 <\/h3>\n<pre>\/**\n * @param {array&lt;*|array&gt;} value\n * @return {array}\n *\/\n\nfunction flatten(arr) {\n  const newarray = [];\n  const copy = [...arr];\n\n  while (copy.length) {\n    const item = copy.shift();\n\n    if (array.isarray(item)) {\n      copy.unshift(...item);\n    } else {\n      newarray.push(item);\n    }\n  }\n\n  return newarray;\n}\n\n\/\/ usage example\nconsole.log(flatten([1, 2, 3])); \/\/ [1, 2, 3]\n\n\/\/ inner arrays are flattened into a single level.\nconsole.log(flatten([1, [2, 3]])); \/\/ [1, 2, 3]\nconsole.log(\n  flatten([\n    [1, 2],\n    [3, 4],\n  ])\n); \/\/ [1, 2, 3, 4]\n\n\/\/ flattens recursively.\nconsole.log(flatten([1, [2, [3, [4, [5]]]]])); \/\/ [1, 2, 3, 4, 5]\n<\/pre>\n<hr>\n<h3> \u751f\u6210\u552f\u4e00\u7684\u968f\u673a\u6570\u7ec4 <\/h3>\n<pre>\/**\n * @param {number} range\n * @param {number} outputcount\n * @return {array}\n *\/\n\nfunction generateuniquerandomarray(range, outputcount) {\n  const arr = array.from({ length: range }, (_, i) =&gt; i + 1);\n  const result = [];\n\n  for (let i = 0; i &lt; outputcount; i += 1) {\n    const randomindex = math.floor(math.random() * arr.length);\n    result.push(arr[randomindex]);\n    arr[randomindex] = arr.at(-1);\n    arr.pop();\n  }\n\n  return result;\n}\n\n\/\/ usage example\nconst uniquerandomnumbers = generateuniquerandomarray(10, 5);\nconsole.log(uniquerandomnumbers); \/\/ =&gt; [3, 7, 1, 9, 5]\n<\/pre>\n<hr>\n<h3> \u4ea4\u53c9\u70b9 <\/h3>\n<pre>\/**\n * @param {function} iteratee\n * @param {array[]} arrays\n * @returns {array}\n *\/\n\nfunction intersectionby(iteratee, ...arrs) {\n  if (!arrs.length) {\n    return [];\n  }\n\n  const mappedarrs = arrs.map((arr) =&gt; arr.map(iteratee));\n  let intersectedvalues = mappedarrs[0].filter((value) =&gt; {\n    return mappedarrs.every((mappedarr) =&gt; mappedarr.includes(value));\n  });\n\n  intersectedvalues = intersectedvalues.filter((value, index, self) =&gt; {\n    return self.indexof(value) === index;\n  });\n\n  return intersectedvalues.map((value) =&gt; {\n    const index = mappedarrs[0].indexof(value);\n    return arrs[0][index];\n  });\n}\n\n\/\/ usage example\nconst result = intersectionby(math.floor, [1.2, 2.4], [2.5, 3.6]); \/\/ =&gt; [2.4]\nconsole.log(result); \/\/ =&gt; [2.4]\n\nconst result2 = intersectionby(\n  (str) =&gt; str.tolowercase(),\n  [\"apple\", \"banana\", \"orange\", \"orange\"],\n  [\"apple\", \"banana\", \"orange\"]\n);\nconsole.log(result2); \/\/ =&gt; ['apple', 'banana', 'orange']\n<\/pre>\n<hr>\n<h3> \u8def\u53e3 <\/h3>\n<pre>\/**\n * @param {array&lt;unknown&gt;[]} arrays - the arrays to find the intersection of.\n * @returns {array&lt;unknown&gt;} - an array containing the elements common to all input arrays.\n *\/\n\nfunction intersectarrays(...arrs) {\n  if (!arrs.length) {\n    return [];\n  }\n\n  const set = new set(arrs[0]);\n\n  for (let i = 1; i &lt; arrs.length; i += 1) {\n    set.foreach((value) =&gt; {\n      if (!arrs[i].includes(value)) {\n        set.delete(value);\n      }\n    });\n  }\n\n  return array.from(set);\n}\n\n\/\/ usage example\nconsole.log(intersectarrays([1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 6])); \/\/ =&gt; [3, 4]\n<\/pre>\n<hr>\n<h3> \u610f\u601d\u662f <\/h3>\n<pre>\/**\n * @param {array} array\n * @return {number}\n *\/\n\nfunction mean(arr) {\n  return arr.reduce((sum, number) =&gt; sum + number, 0) \/ arr.length;\n}\n\n\/\/ usage example\nconsole.log(mean([1, 2, 3])); \/\/ =&gt; 2\nconsole.log(mean([1, 2, 3, 4, 5])); \/\/ =&gt; 3\n<\/pre>\n<hr>\n<h3> \u5220\u9664\u91cd\u590d\u9879 <\/h3>\n<pre>\/**\n * @param {*} arr\n *\/\n\nfunction removeduplicates(arr) {\n  return array.from(new set(arr));\n}\n\n\/\/ usage example\nconst inputarray = [1, 2, 3, 2, 1, 4, 5, 6, 5, 4];\nconst outputarray = removeduplicates(inputarray);\n\nconsole.log(outputarray); \/\/ =&gt; [1, 2, 3, 4, 5, 6]\n<\/pre>\n<hr>\n<h3> \u968f\u673a\u64ad\u653e <\/h3>\n<pre>\/**\n * @param {any[]} arr\n * @returns {void}\n *\/\nfunction shuffle(arr) {\n  if (arr.length &lt; 1) {\n    return [];\n  }\n\n  for (let i = 0; i &lt; arr.length; i += 1) {\n    const randidx = math.floor(math.random() * (i + 1));\n    [arr[randidx], arr[i]] = [arr[i], arr[randidx]];\n  }\n\n  return arr;\n}\n\n\/\/ usage example\nconsole.log(shuffle([1, 2, 3, 4])); \/\/ =&gt; [*, *, *, *]\n<\/pre>\n<hr>\n<h3> \u6392\u5e8f\u65b9\u5f0f <\/h3>\n<pre>\/**\n * @param {array} arr\n * @param {function} fn\n * @return {array}\n *\/\n\nfunction sortby(arr, fn) {\n  return arr.sort((a, b) =&gt; fn(a) - fn(b));\n}\n\n\/\/ usage example\nconsole.log(sortby([5, 4, 1, 2, 3], (x) =&gt; x)); \/\/ =&gt; [1, 2, 3, 4, 5]\n<\/pre>\n<hr>\n<h3> \u6811\u5230\u6570\u7ec4 <\/h3>\n<pre>\/**\n * @param {Array} tree\n * @param {number} parentId\n * @return {Array}\n *\/\n\nfunction treeToArr(tree, parentId = null) {\n  const arr = [];\n\n  tree.forEach((node) =&gt; {\n    const { id, name } = node;\n    arr.push({ id, name, parentId });\n\n    \/\/ recursive\n    if (node.children &amp;&amp; node.children.length &gt; 0) {\n      arr.push(...treeToArr(node.children, id));\n    }\n  });\n\n  return arr;\n}\n\n\/\/ Usage example\nconst tree = [\n  {\n    id: 1,\n    name: \"Node 1\",\n    children: [\n      {\n        id: 2,\n        name: \"Node 1.1\",\n        children: [\n          {\n            id: 4,\n            name: \"Node 1.1.1\",\n            children: [],\n          },\n        ],\n      },\n      {\n        id: 3,\n        name: \"Node 1.2\",\n        children: [],\n      },\n    ],\n  },\n  {\n    id: 5,\n    name: \"Node 2\",\n    children: [\n      {\n        id: 6,\n        name: \"Node 2.1\",\n        children: [],\n      },\n      {\n        id: 7,\n        name: \"Node 2.2\",\n        children: [],\n      },\n    ],\n  },\n];\nconst flatArray = treeToArr(tree);\nconsole.log(flatArray);\n\/*\n[\n  { id: 1, name: 'Node 1', parentId: null },\n  { id: 2, name: 'Node 1.1', parentId: 1 },\n  { id: 4, name: 'Node 1.1.1', parentId: 2 },\n  { id: 3, name: 'Node 1.2', parentId: 1 },\n  { id: 5, name: 'Node 2', parentId: null },\n  { id: 6, name: 'Node 2.1', parentId: 5 },\n  { id: 7, name: 'Node 2.2', parentId: 5 }\n]\n*\/\n<\/pre>\n<hr>\n<h3> \u53c2\u8003 <\/h3>\n<ul>\n<li>2695\u3002\u6570\u7ec4\u5305\u88c5\u5668 &#8211; leetcode<\/li>\n<li>2677\u3002\u5757\u6570\u7ec4 &#8211; leetcode<\/li>\n<li>2724\u3002\u6392\u5e8f\u4f9d\u636e &#8211; leetcode<\/li>\n<li>2625\u3002\u5c55\u5e73\u6df1\u5ea6\u5d4c\u5957\u6570\u7ec4 &#8211; leetcode<\/li>\n<li>131\u3002\u5b9e\u73b0 _.chunk() &#8211; bfe.dev<\/li>\n<li>8.\u4f60\u80fd shuffle() \u4e00\u4e2a\u6570\u7ec4\u5417\uff1f &#8211; bfe.dev<\/li>\n<li>384\u3002\u968f\u673a\u6392\u5217\u6570\u7ec4 &#8211; leetcode<\/li>\n<li>138\u3002\u4e24\u4e2a\u6392\u5e8f\u6570\u7ec4\u7684\u4ea4\u96c6 &#8211; bfe.dev<\/li>\n<li>167\u3002\u672a\u6392\u5e8f\u6570\u7ec4\u7684\u4ea4\u96c6 &#8211; bfe.dev<\/li>\n<li>66\u3002\u4ece\u6570\u7ec4\u4e2d\u5220\u9664\u91cd\u590d\u9879 &#8211; bfe.dev<\/li>\n<\/ul>\n<p>\u7406\u8bba\u8981\u638c\u63e1\uff0c\u5b9e\u64cd\u4e0d\u80fd\u843d\uff01\u4ee5\u4e0a\u5173\u4e8e\u300aArray &#8211; JavaScript Challenges\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   \u7535\u8111\u600e\u4e48\u7981\u6b62\u9501\u5c4f win11\u7cfb\u7edf\u7981\u6b62\u9501\u5b9a\u5c4f\u5e55\u7684\u65b9\u6cd5\u6559\u7a0b\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>Array &#8211; JavaScript Challenges \u6536\u85cf \u4e00\u5206\u8015\u8018\uff0c\u4e00\u5206\u6536\u83b7\uff01\u65e2\u7136\u90fd\u6253\u5f00\u8fd9\u7bc7\u300aArray &#8211; JavaScript Challenges\u300b\uff0c\u5c31\u575a\u6301\u770b\u4e0b\u53bb\uff0c\u5b66\u4e0b\u53bb\u5427\uff01\u672c\u6587\u4e3b\u8981\u4f1a\u7ed9\u5927\u5bb6\u8bb2\u5230\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u5927\u5bb6\u5bf9\u672c\u6587\u6709\u597d\u7684\u5efa\u8bae\u6216\u8005\u770b\u5230\u6709\u4e0d\u8db3\u4e4b\u5904\uff0c\u975e\u5e38\u6b22\u8fce\u5927\u5bb6\u79ef\u6781\u63d0\u51fa\uff01\u5728\u540e\u7eed\u6587\u7ae0\u6211\u4f1a\u7ee7\u7eed\u66f4\u65b0\u6587\u7ae0\u76f8\u5173\u7684\u5185\u5bb9\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u90fd\u6709\u6240\u5e2e\u52a9\uff01 \u60a8\u53ef\u4ee5\u5728 repo github \u4e0a\u627e\u5230\u8fd9\u7bc7\u6587\u7ae0\u4e2d\u7684\u6240\u6709\u4ee3\u7801\u3002 \u9635\u5217\u76f8\u5173\u7684\u6311\u6218 \u6570\u7ec4 \/** * @return {array} *\/ function arrayof(arr) { return [].slice.call(arguments); } \/\/ usage example const array1 = [1, 2, 3]; const array2 = [4, 5, 6]; const combinedarray = arrayof(array1, array2); console.log(combinedarray); \/\/ =&gt; [ [ 1, 2, 3 ], [&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-52878","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52878","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=52878"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52878\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}