{"id":601,"date":"2024-01-02T09:01:01","date_gmt":"2024-01-02T01:01:01","guid":{"rendered":""},"modified":"2024-01-02T09:01:01","modified_gmt":"2024-01-02T01:01:01","slug":"\u6570\u7ec4\u53bb\u91cd\u65b9\u6cd5\uff08\u5305\u62ec\u590d\u6742\u7c7b\u578b\uff09","status":"publish","type":"post","link":"https:\/\/mushiming.com\/601.html","title":{"rendered":"\u6570\u7ec4\u53bb\u91cd\u65b9\u6cd5\uff08\u5305\u62ec\u590d\u6742\u7c7b\u578b\uff09"},"content":{"rendered":"

\n <\/path> \n<\/svg> <\/p>\n

\/\/ 1.ES6 Set\u53bb\u91cd\uff08ES6\u4e2d\u6700\u5e38\u7528\uff09<\/span>\nfunction<\/span> unique<\/span> (<\/span>arr<\/span>)<\/span> { \n   <\/span>\n  return<\/span> Array.<\/span>from<\/span>(<\/span>new<\/span> Set<\/span>(<\/span>arr)<\/span>)<\/span>\n}<\/span>\nvar<\/span> arr =<\/span> [<\/span>1<\/span>,<\/span>1<\/span>,<\/span>'true'<\/span>,<\/span>'true'<\/span>,<\/span>true<\/span>,<\/span>true<\/span>,<\/span>15<\/span>,<\/span>15<\/span>,<\/span>false<\/span>,<\/span>false<\/span>,<\/span> undefined<\/span>,<\/span>undefined<\/span>,<\/span> null<\/span>,<\/span>null<\/span>,<\/span> NaN<\/span>,<\/span> NaN<\/span>,<\/span>'NaN'<\/span>,<\/span> 0<\/span>,<\/span> 0<\/span>,<\/span> 'a'<\/span>,<\/span> 'a'<\/span>,<\/span>{ \n   <\/span>}<\/span>,<\/span>{ \n   <\/span>}<\/span>]<\/span>;<\/span>\nconsole.<\/span>log<\/span>(<\/span>unique<\/span>(<\/span>arr)<\/span>)<\/span>\n \/\/[1, \"true\", true, 15, false, undefined, null, NaN, \"NaN\", 0, \"a\", {}, {}]<\/span>\n\n\/\/ 2.\u5229\u7528for\u5d4c\u5957for\uff0c\u7136\u540esplice\u53bb\u91cd\uff08ES5\u4e2d\u6700\u5e38\u7528\uff09<\/span>\nfunction<\/span> unique<\/span>(<\/span>arr<\/span>)<\/span>{ \n   <\/span>            \n        for<\/span>(<\/span>var<\/span> i=<\/span>0<\/span>;<\/span> i<<\/span>arr.<\/span>length;<\/span> i++<\/span>)<\/span>{ \n   <\/span>\n            for<\/span>(<\/span>var<\/span> j=<\/span>i+<\/span>1<\/span>;<\/span> j<<\/span>arr.<\/span>length;<\/span> j++<\/span>)<\/span>{ \n   <\/span>\n                if<\/span>(<\/span>arr[<\/span>i]<\/span>==<\/span>arr[<\/span>j]<\/span>)<\/span>{ \n   <\/span>         \/\/\u7b2c\u4e00\u4e2a\u7b49\u540c\u4e8e\u7b2c\u4e8c\u4e2a\uff0csplice\u65b9\u6cd5\u5220\u9664\u7b2c\u4e8c\u4e2a<\/span>\n                    arr.<\/span>splice<\/span>(<\/span>j,<\/span>1<\/span>)<\/span>;<\/span>\n                    j--<\/span>;<\/span>\n                }<\/span>\n            }<\/span>\n        }<\/span>\nreturn<\/span> arr;<\/span>\n}<\/span>\nvar<\/span> arr =<\/span> [<\/span>1<\/span>,<\/span>1<\/span>,<\/span>'true'<\/span>,<\/span>'true'<\/span>,<\/span>true<\/span>,<\/span>true<\/span>,<\/span>15<\/span>,<\/span>15<\/span>,<\/span>false<\/span>,<\/span>false<\/span>,<\/span> undefined<\/span>,<\/span>undefined<\/span>,<\/span> null<\/span>,<\/span>null<\/span>,<\/span> NaN<\/span>,<\/span> NaN<\/span>,<\/span>'NaN'<\/span>,<\/span> 0<\/span>,<\/span> 0<\/span>,<\/span> 'a'<\/span>,<\/span> 'a'<\/span>,<\/span>{ \n   <\/span>}<\/span>,<\/span>{ \n   <\/span>}<\/span>]<\/span>;<\/span>\n    console.<\/span>log<\/span>(<\/span>unique<\/span>(<\/span>arr)<\/span>)<\/span>\n    \/\/[1, \"true\", 15, false, undefined, NaN, NaN, \"NaN\", \"a\", {\u2026}, {\u2026}] \/\/NaN\u548c{}\u6ca1\u6709\u53bb\u91cd\uff0c\u4e24\u4e2anull\u76f4\u63a5\u6d88\u5931\u4e86<\/span>\n\n\/\/ 3.\u5229\u7528indexOf\u53bb\u91cd<\/span>\nfunction<\/span> unique<\/span>(<\/span>arr<\/span>)<\/span> { \n   <\/span>\n    if<\/span> (<\/span>!<\/span>Array.<\/span>isArray<\/span>(<\/span>arr)<\/span>)<\/span> { \n   <\/span>\n        console.<\/span>log<\/span>(<\/span>'type error!'<\/span>)<\/span>\n        return<\/span>\n    }<\/span>\n    var<\/span> array =<\/span> [<\/span>]<\/span>;<\/span>\n    for<\/span> (<\/span>var<\/span> i =<\/span> 0<\/span>;<\/span> i <<\/span> arr.<\/span>length;<\/span> i++<\/span>)<\/span> { \n   <\/span>\n        if<\/span> (<\/span>array .<\/span>indexOf<\/span>(<\/span>arr[<\/span>i]<\/span>)<\/span> ===<\/span> -<\/span>1<\/span>)<\/span> { \n   <\/span>\n            array .<\/span>push<\/span>(<\/span>arr[<\/span>i]<\/span>)<\/span>\n        }<\/span>\n    }<\/span>\n    return<\/span> array;<\/span>\n}<\/span>\nvar<\/span> arr =<\/span> [<\/span>1<\/span>,<\/span>1<\/span>,<\/span>'true'<\/span>,<\/span>'true'<\/span>,<\/span>true<\/span>,<\/span>true<\/span>,<\/span>15<\/span>,<\/span>15<\/span>,<\/span>false<\/span>,<\/span>false<\/span>,<\/span> undefined<\/span>,<\/span>undefined<\/span>,<\/span> null<\/span>,<\/span>null<\/span>,<\/span> NaN<\/span>,<\/span> NaN<\/span>,<\/span>'NaN'<\/span>,<\/span> 0<\/span>,<\/span> 0<\/span>,<\/span> 'a'<\/span>,<\/span> 'a'<\/span>,<\/span>{ \n   <\/span>}<\/span>,<\/span>{ \n   <\/span>}<\/span>]<\/span>;<\/span>\nconsole.<\/span>log<\/span>(<\/span>unique<\/span>(<\/span>arr)<\/span>)<\/span>\n \/\/ [1, \"true\", true, 15, false, undefined, null, NaN, NaN, \"NaN\", 0, \"a\", {\u2026}, {\u2026}] \/\/NaN\u3001{}\u6ca1\u6709\u53bb\u91cd<\/span>\n\n\/\/ 4.\u5229\u7528sort()<\/span>\nfunction<\/span> unique<\/span>(<\/span>arr<\/span>)<\/span> { \n   <\/span>\n    if<\/span> (<\/span>!<\/span>Array.<\/span>isArray<\/span>(<\/span>arr)<\/span>)<\/span> { \n   <\/span>\n        console.<\/span>log<\/span>(<\/span>'type error!'<\/span>)<\/span>\n        return<\/span>;<\/span>\n    }<\/span>\n    arr =<\/span> arr.<\/span>sort<\/span>(<\/span>)<\/span>\n    var<\/span> arrry=<\/span> [<\/span>arr[<\/span>0<\/span>]<\/span>]<\/span>;<\/span>\n    for<\/span> (<\/span>var<\/span> i =<\/span> 1<\/span>;<\/span> i <<\/span> arr.<\/span>length;<\/span> i++<\/span>)<\/span> { \n   <\/span>\n        if<\/span> (<\/span>arr[<\/span>i]<\/span> !==<\/span> arr[<\/span>i-<\/span>1<\/span>]<\/span>)<\/span> { \n   <\/span>\n            arrry.<\/span>push<\/span>(<\/span>arr[<\/span>i]<\/span>)<\/span>;<\/span>\n        }<\/span>\n    }<\/span>\n    return<\/span> arrry;<\/span>\n}<\/span>\n     var<\/span> arr =<\/span> [<\/span>1<\/span>,<\/span>1<\/span>,<\/span>'true'<\/span>,<\/span>'true'<\/span>,<\/span>true<\/span>,<\/span>true<\/span>,<\/span>15<\/span>,<\/span>15<\/span>,<\/span>false<\/span>,<\/span>false<\/span>,<\/span> undefined<\/span>,<\/span>undefined<\/span>,<\/span> null<\/span>,<\/span>null<\/span>,<\/span> NaN<\/span>,<\/span> NaN<\/span>,<\/span>'NaN'<\/span>,<\/span> 0<\/span>,<\/span> 0<\/span>,<\/span> 'a'<\/span>,<\/span> 'a'<\/span>,<\/span>{ \n   <\/span>}<\/span>,<\/span>{ \n   <\/span>}<\/span>]<\/span>;<\/span>\n        console.<\/span>log<\/span>(<\/span>unique<\/span>(<\/span>arr)<\/span>)<\/span>\n\/\/ [0, 1, 15, \"NaN\", NaN, NaN, {\u2026}, {\u2026}, \"a\", false, null, true, \"true\", undefined] \/\/NaN\u3001{}\u6ca1\u6709\u53bb\u91cd<\/span>\n\n\/\/ 5.\u5229\u7528includes<\/span>\nfunction<\/span> unique<\/span>(<\/span>arr<\/span>)<\/span> { \n   <\/span>\n    if<\/span> (<\/span>!<\/span>Array.<\/span>isArray<\/span>(<\/span>arr)<\/span>)<\/span> { \n   <\/span>\n        console.<\/span>log<\/span>(<\/span>'type error!'<\/span>)<\/span>\n        return<\/span>\n    }<\/span>\n    var<\/span> array =<\/span>[<\/span>]<\/span>;<\/span>\n    for<\/span>(<\/span>var<\/span> i =<\/span> 0<\/span>;<\/span> i <<\/span> arr.<\/span>length;<\/span> i++<\/span>)<\/span> { \n   <\/span>\n            if<\/span>(<\/span> !<\/span>array.<\/span>includes<\/span>(<\/span> arr[<\/span>i]<\/span>)<\/span> )<\/span> { \n   <\/span>\/\/includes \u68c0\u6d4b\u6570\u7ec4\u662f\u5426\u6709\u67d0\u4e2a\u503c<\/span>\n                    array.<\/span>push<\/span>(<\/span>arr[<\/span>i]<\/span>)<\/span>;<\/span>\n              }<\/span>\n    }<\/span>\n    return<\/span> array\n}<\/span>\nvar<\/span> arr =<\/span> [<\/span>1<\/span>,<\/span>1<\/span>,<\/span>'true'<\/span>,<\/span>'true'<\/span>,<\/span>true<\/span>,<\/span>true<\/span>,<\/span>15<\/span>,<\/span>15<\/span>,<\/span>false<\/span>,<\/span>false<\/span>,<\/span> undefined<\/span>,<\/span>undefined<\/span>,<\/span> null<\/span>,<\/span>null<\/span>,<\/span> NaN<\/span>,<\/span> NaN<\/span>,<\/span>'NaN'<\/span>,<\/span> 0<\/span>,<\/span> 0<\/span>,<\/span> 'a'<\/span>,<\/span> 'a'<\/span>,<\/span>{ \n   <\/span>}<\/span>,<\/span>{ \n   <\/span>}<\/span>]<\/span>;<\/span>\n    console.<\/span>log<\/span>(<\/span>unique<\/span>(<\/span>arr)<\/span>)<\/span>\n    \/\/[1, \"true\", true, 15, false, undefined, null, NaN, \"NaN\", 0, \"a\", {\u2026}, {\u2026}] \/\/{}\u6ca1\u6709\u53bb\u91cd<\/span>\n\n\n\/\/ 6.\u5229\u7528filter<\/span>\nfunction<\/span> unique<\/span>(<\/span>arr<\/span>)<\/span> { \n   <\/span>\n  return<\/span> arr.<\/span>filter<\/span>(<\/span>function<\/span>(<\/span>item,<\/span> index,<\/span> arr<\/span>)<\/span> { \n   <\/span>\n    \/\/\u5f53\u524d\u5143\u7d20\uff0c\u5728\u539f\u59cb\u6570\u7ec4\u4e2d\u7684\u7b2c\u4e00\u4e2a\u7d22\u5f15==\u5f53\u524d\u7d22\u5f15\u503c\uff0c\u5426\u5219\u8fd4\u56de\u5f53\u524d\u5143\u7d20<\/span>\n    return<\/span> arr.<\/span>indexOf<\/span>(<\/span>item,<\/span> 0<\/span>)<\/span> ===<\/span> index;<\/span>\n  }<\/span>)<\/span>;<\/span>\n}<\/span>\n    var<\/span> arr =<\/span> [<\/span>1<\/span>,<\/span>1<\/span>,<\/span>'true'<\/span>,<\/span>'true'<\/span>,<\/span>true<\/span>,<\/span>true<\/span>,<\/span>15<\/span>,<\/span>15<\/span>,<\/span>false<\/span>,<\/span>false<\/span>,<\/span> undefined<\/span>,<\/span>undefined<\/span>,<\/span> null<\/span>,<\/span>null<\/span>,<\/span> NaN<\/span>,<\/span> NaN<\/span>,<\/span>'NaN'<\/span>,<\/span> 0<\/span>,<\/span> 0<\/span>,<\/span> 'a'<\/span>,<\/span> 'a'<\/span>,<\/span>{ \n   <\/span>}<\/span>,<\/span>{ \n   <\/span>}<\/span>]<\/span>;<\/span>\n        console.<\/span>log<\/span>(<\/span>unique<\/span>(<\/span>arr)<\/span>)<\/span>\n\/\/[1, \"true\", true, 15, false, undefined, null, \"NaN\", 0, \"a\", {\u2026}, {\u2026}]<\/span>\n\n\n\/\/ 7.\u5229\u7528\u9012\u5f52\u53bb\u91cd<\/span>\nfunction<\/span> unique<\/span>(<\/span>arr<\/span>)<\/span> { \n   <\/span>\n        var<\/span> array=<\/span> arr;<\/span>\n        var<\/span> len =<\/span> array.<\/span>length;<\/span>\n\n    array.<\/span>sort<\/span>(<\/span>function<\/span>(<\/span>a,<\/span>b<\/span>)<\/span>{ \n   <\/span>   \/\/\u6392\u5e8f\u540e\u66f4\u52a0\u65b9\u4fbf\u53bb\u91cd<\/span>\n        return<\/span> a -<\/span> b;<\/span>\n    }<\/span>)<\/span>\n\n    function<\/span> loop<\/span>(<\/span>index<\/span>)<\/span>{ \n   <\/span>\n        if<\/span>(<\/span>index >=<\/span> 1<\/span>)<\/span>{ \n   <\/span>\n            if<\/span>(<\/span>array[<\/span>index]<\/span> ===<\/span> array[<\/span>index-<\/span>1<\/span>]<\/span>)<\/span>{ \n   <\/span>\n                array.<\/span>splice<\/span>(<\/span>index,<\/span>1<\/span>)<\/span>;<\/span>\n            }<\/span>\n            loop<\/span>(<\/span>index -<\/span> 1<\/span>)<\/span>;<\/span>    \/\/\u9012\u5f52loop\uff0c\u7136\u540e\u6570\u7ec4\u53bb\u91cd<\/span>\n        }<\/span>\n    }<\/span>\n    loop<\/span>(<\/span>len-<\/span>1<\/span>)<\/span>;<\/span>\n    return<\/span> array;<\/span>\n}<\/span>\n var<\/span> arr =<\/span> [<\/span>1<\/span>,<\/span>1<\/span>,<\/span>'true'<\/span>,<\/span>'true'<\/span>,<\/span>true<\/span>,<\/span>true<\/span>,<\/span>15<\/span>,<\/span>15<\/span>,<\/span>false<\/span>,<\/span>false<\/span>,<\/span> undefined<\/span>,<\/span>undefined<\/span>,<\/span> null<\/span>,<\/span>null<\/span>,<\/span> NaN<\/span>,<\/span> NaN<\/span>,<\/span>'NaN'<\/span>,<\/span> 0<\/span>,<\/span> 0<\/span>,<\/span> 'a'<\/span>,<\/span> 'a'<\/span>,<\/span>{ \n   <\/span>}<\/span>,<\/span>{ \n   <\/span>}<\/span>]<\/span>;<\/span>\nconsole.<\/span>log<\/span>(<\/span>unique<\/span>(<\/span>arr)<\/span>)<\/span>\n\/\/[1, \"a\", \"true\", true, 15, false, 1, {\u2026}, null, NaN, NaN, \"NaN\", 0, \"a\", {\u2026}, undefined]<\/span>\n\n\n\/\/ 8.\u5229\u7528Map\u6570\u636e\u7ed3\u6784\u53bb\u91cd<\/span>\nfunction<\/span> arrayNonRepeatfy<\/span>(<\/span>arr<\/span>)<\/span> { \n   <\/span>\n  let<\/span> map =<\/span> new<\/span> Map<\/span>(<\/span>)<\/span>;<\/span>\n  let<\/span> array =<\/span> new<\/span> Array<\/span>(<\/span>)<\/span>;<\/span>  \/\/ \u6570\u7ec4\u7528\u4e8e\u8fd4\u56de\u7ed3\u679c<\/span>\n  for<\/span> (<\/span>let<\/span> i =<\/span> 0<\/span>;<\/span> i <<\/span> arr.<\/span>length;<\/span> i++<\/span>)<\/span> { \n   <\/span>\n    if<\/span>(<\/span>map .<\/span>has<\/span>(<\/span>arr[<\/span>i]<\/span>)<\/span>)<\/span> { \n   <\/span>  \/\/ \u5982\u679c\u6709\u8be5key\u503c<\/span>\n      map .<\/span>set<\/span>(<\/span>arr[<\/span>i]<\/span>,<\/span> true<\/span>)<\/span>;<\/span> \n    }<\/span> else<\/span> { \n   <\/span> \n      map .<\/span>set<\/span>(<\/span>arr[<\/span>i]<\/span>,<\/span> false<\/span>)<\/span>;<\/span>   \/\/ \u5982\u679c\u6ca1\u6709\u8be5key\u503c<\/span>\n      array .<\/span>push<\/span>(<\/span>arr[<\/span>i]<\/span>)<\/span>;<\/span>\n    }<\/span>\n  }<\/span> \n  return<\/span> array ;<\/span>\n}<\/span>\n var<\/span> arr =<\/span> [<\/span>1<\/span>,<\/span>1<\/span>,<\/span>'true'<\/span>,<\/span>'true'<\/span>,<\/span>true<\/span>,<\/span>true<\/span>,<\/span>15<\/span>,<\/span>15<\/span>,<\/span>false<\/span>,<\/span>false<\/span>,<\/span> undefined<\/span>,<\/span>undefined<\/span>,<\/span> null<\/span>,<\/span>null<\/span>,<\/span> NaN<\/span>,<\/span> NaN<\/span>,<\/span>'NaN'<\/span>,<\/span> 0<\/span>,<\/span> 0<\/span>,<\/span> 'a'<\/span>,<\/span> 'a'<\/span>,<\/span>{ \n   <\/span>}<\/span>,<\/span>{ \n   <\/span>}<\/span>]<\/span>;<\/span>\n    console.<\/span>log<\/span>(<\/span>unique<\/span>(<\/span>arr)<\/span>)<\/span>\n\/\/[1, \"a\", \"true\", true, 15, false, 1, {\u2026}, null, NaN, NaN, \"NaN\", 0, \"a\", {\u2026}, undefined]<\/span>\n\n\/\/ 9. \u5229\u7528reduce+includes<\/span>\nfunction<\/span> unique<\/span>(<\/span>arr<\/span>)<\/span>{ \n   <\/span>\n    return<\/span> arr.<\/span>reduce<\/span>(<\/span>(<\/span>prev,<\/span>cur<\/span>)<\/span> =><\/span> prev.<\/span>includes<\/span>(<\/span>cur)<\/span> ?<\/span> prev :<\/span> [<\/span>...<\/span>prev,<\/span>cur]<\/span>,<\/span>[<\/span>]<\/span>)<\/span>;<\/span>\n}<\/span>\nvar<\/span> arr =<\/span> [<\/span>1<\/span>,<\/span>1<\/span>,<\/span>'true'<\/span>,<\/span>'true'<\/span>,<\/span>true<\/span>,<\/span>true<\/span>,<\/span>15<\/span>,<\/span>15<\/span>,<\/span>false<\/span>,<\/span>false<\/span>,<\/span> undefined<\/span>,<\/span>undefined<\/span>,<\/span> null<\/span>,<\/span>null<\/span>,<\/span> NaN<\/span>,<\/span> NaN<\/span>,<\/span>'NaN'<\/span>,<\/span> 0<\/span>,<\/span> 0<\/span>,<\/span> 'a'<\/span>,<\/span> 'a'<\/span>,<\/span>{ \n   <\/span>}<\/span>,<\/span>{ \n   <\/span>}<\/span>]<\/span>;<\/span>\nconsole.<\/span>log<\/span>(<\/span>unique<\/span>(<\/span>arr)<\/span>)<\/span>;<\/span>\n\/\/ [1, \"true\", true, 15, false, undefined, null, NaN, \"NaN\", 0, \"a\", {\u2026}, {\u2026}]<\/span>\n\n\/\/ 10.[...new Set(arr)]<\/span>\n[<\/span>...<\/span>new<\/span> Set<\/span>(<\/span>arr)<\/span>]<\/span> \n\n\n\/\/ 11. hasOwnProperty , \u53ef\u4ee5\u53bb\u91cd\u590d\u6742\u6570\u636e\u7c7b\u578b<\/span>\nfunction<\/span> unique<\/span>(<\/span>arr<\/span>)<\/span> { \n   <\/span>\n    var<\/span> obj =<\/span> { \n   <\/span>}<\/span>;<\/span>\n    return<\/span> arr.<\/span>filter<\/span>(<\/span>function<\/span>(<\/span>item,<\/span> index,<\/span> arr<\/span>)<\/span>{ \n   <\/span>\n        return<\/span> obj.<\/span>hasOwnProperty<\/span>(<\/span>typeof<\/span> item +<\/span> item)<\/span> ?<\/span> false<\/span> :<\/span> (<\/span>obj[<\/span>typeof<\/span> item +<\/span> item]<\/span> =<\/span> true<\/span>)<\/span>\n    }<\/span>)<\/span>\n}<\/span>\n    var<\/span> arr =<\/span> [<\/span>1<\/span>,<\/span>1<\/span>,<\/span>'true'<\/span>,<\/span>'true'<\/span>,<\/span>true<\/span>,<\/span>true<\/span>,<\/span>15<\/span>,<\/span>15<\/span>,<\/span>false<\/span>,<\/span>false<\/span>,<\/span> undefined<\/span>,<\/span>undefined<\/span>,<\/span> null<\/span>,<\/span>null<\/span>,<\/span> NaN<\/span>,<\/span> NaN<\/span>,<\/span>'NaN'<\/span>,<\/span> 0<\/span>,<\/span> 0<\/span>,<\/span> 'a'<\/span>,<\/span> 'a'<\/span>,<\/span>{ \n   <\/span>}<\/span>,<\/span>{ \n   <\/span>}<\/span>]<\/span>;<\/span>\n        console.<\/span>log<\/span>(<\/span>unique<\/span>(<\/span>arr)<\/span>)<\/span>\n\/\/[1, \"true\", true, 15, false, undefined, null, NaN, \"NaN\", 0, \"a\", {\u2026}] \/\/\u6240\u6709\u7684\u90fd\u53bb\u91cd\u4e86<\/span>\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"\u6570\u7ec4\u53bb\u91cd\u65b9\u6cd5\uff08\u5305\u62ec\u590d\u6742\u7c7b\u578b\uff09\/\/1.ES6Set\u53bb\u91cd\uff08ES6\u4e2d\u6700\u5e38\u7528\uff09functionunique(arr){returnArray.from(newSet(arr))}vararr=[1,...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/601"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=601"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/601\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}