[{"data":1,"prerenderedAt":1520},["ShallowReactive",2],{"blog-taxonomies":3,"blog-stats":507,"post-2025\u002F2025-12-25-关于javascript的set方法":1083},[4,11,16,21,25,29,36,39,44,47,52,58,63,66,71,76,80,84,87,93,96,101,105,110,113,117,122,127,132,136,141,143,146,151,155,157,162,165,169,173,176,179,183,186,190,193,197,200,205,208,211,214,219,222,228,234,237,239,245,249,253,256,260,266,271,276,281,283,287,290,293,298,301,304,306,308,311,314,316,318,321,327,332,337,342,347,352,354,356,358,361,365,367,369,371,374,376,378,381,386,390,393,396,400,404,407,411,413,415,417,421,423,425,428,431,433,435,437,439,441,443,446,448,450,454,456,459,461,463,465,467,469,471,473,477,483,486,488,491,493,495,497,499,501,503,505],{"category":5,"tags":6},"笔记",[7,8,9,10],"QQ","插件","LiteLoader","美化",{"category":12,"tags":13},"其他",[14,15,10],"博客","IP签名",{"category":17,"tags":18},"杂谈",[19,20],"互联网","观点",{"category":5,"tags":22},[14,23,24],"GitHub","数据可视化",{"category":5,"tags":26},[14,27,28],"访问统计","不蒜子",{"category":30,"tags":31},"工具",[32,33,34,35],"Python","爬虫","选课脚本","广州大学",{"category":5,"tags":37},[38,5],"数学分析",{"category":40,"tags":41},"算法",[42,40,43],"数据结构","线性表",{"category":40,"tags":45},[42,46],"复习",{"category":5,"tags":48},[49,50,51],"高等代数","线性代数","知识点",{"category":5,"tags":53},[14,54,55,56,57],"Typora","PicGo","图床","Markdown",{"category":30,"tags":59},[60,61,62],"Jupyter","工具配置","中文",{"category":30,"tags":64},[65,61,10],"VSCode",{"category":30,"tags":67},[68,69,70,35],"路由器","OpenWrt","校园网",{"category":12,"tags":72},[73,74,75],"网络协议","Wireshark","DEVP2P",{"category":5,"tags":77},[73,74,78,79],"Lua","解码器",{"category":5,"tags":81},[82,5,83],"常微分方程","数学",{"category":5,"tags":85},[86,5,83],"概率论",{"category":30,"tags":88},[89,90,91,92],"Docker","WSL","Windows","磁盘清理",{"category":30,"tags":94},[32,33,95,35],"课程表",{"category":5,"tags":97},[14,98,99,100],"Hexo","Gitalk","评论系统",{"category":5,"tags":102},[14,103,98,104],"Obsidian","写作工具",{"category":12,"tags":106},[107,108,109],"课题研究","泊松分布","参数估计",{"category":12,"tags":111},[107,108,109,112],"组会",{"category":12,"tags":114},[109,115,108,116],"IM模型","统计学",{"category":17,"tags":118},[119,120,121],"软考","网络规划","信息系统项目管理",{"category":30,"tags":123},[124,125,126],"Arch Linux","AppImage","Linux",{"category":5,"tags":128},[129,130,131],"编程语言","计算机科学","内存管理",{"category":5,"tags":133},[134,135],"Canvas","前端",{"category":5,"tags":137},[14,138,139,140],"GitHub Actions","Vite","部署",{"category":5,"tags":142},[135],{"category":5,"tags":144},[135,145],"系统设计",{"category":5,"tags":147},[135,148,149,150],"安全","XSS","CSRF",{"category":152,"tags":153},"项目",[134,154],"PixiJS",{"category":152,"tags":156},null,{"category":40,"tags":158},[42,159,160,161],"栈","队列","JavaScript",{"category":40,"tags":163},[42,164,161],"哈希表",{"category":5,"tags":166},[167,161,168],"ES6","Set",{"category":40,"tags":170},[40,171,172],"动态规划","背包问题",{"category":40,"tags":174},[40,175],"滑动窗口",{"category":40,"tags":177},[42,178,161],"链表",{"category":40,"tags":180},[40,181,161,182],"ACM","面试",{"category":40,"tags":184},[40,161,185],"数据类型转换",{"category":40,"tags":187},[42,188,178,189],"顺序表","TypeScript",{"category":5,"tags":191},[135,154,134,192],"渲染",{"category":5,"tags":194},[135,195,134,196],"富文本编辑","wangEditor",{"category":40,"tags":198},[199,40,178],"力扣",{"category":5,"tags":201},[202,203,204,91],"DNS","加密","网络安全",{"category":5,"tags":206},[135,207],"Axios",{"category":5,"tags":209},[135,207,189,210],"接口封装",{"category":5,"tags":212},[135,213,145],"JWT",{"category":152,"tags":215},[134,216,217,154,218],"画布","React","项目开发",{"category":17,"tags":220},[221],"日志",{"category":5,"tags":223},[224,225,226,227],"Neo4j","图数据库","中心度分析","PageRank",{"category":12,"tags":229},[230,231,232,233],"论文","机器学习","随机森林","保险欺诈",{"category":5,"tags":235},[236],"人工智能",{"category":5,"tags":238},[231,40,32],{"category":12,"tags":240},[241,242,243,244],"共识算法","最长链","区块链","算法设计",{"category":5,"tags":246},[161,247,248,135],"闭包","作用域",{"category":5,"tags":250},[14,138,251,252],"RSS","自动化",{"category":30,"tags":254},[89,90,91,255],"安装",{"category":30,"tags":257},[258,91,259],"MSYS2","开发环境",{"category":5,"tags":261},[262,263,264,265],"团队协作","Git","Commit规范","代码审查",{"category":30,"tags":267},[268,269,270],"oh-my-posh","终端美化","CLI",{"category":5,"tags":272},[273,274,275],"上下文工程","Agent","RAG",{"category":5,"tags":277},[278,279,280],"前端工程化","技术选型","工程基建",{"category":5,"tags":282},[275],{"category":5,"tags":284},[285,286],"SDD","规格驱动开发",{"category":5,"tags":288},[289],"neovim",{"category":5,"tags":291},[292],"技术写作",{"category":5,"tags":294},[295,32,296,89,297],"FastAPI","后端","工程实践",{"category":152,"tags":299},[274,300],"Harness Engineering",{"category":5,"tags":302},[303],"RFC",{"category":152,"tags":305},[274,300,275],{"category":152,"tags":307},[274],{"category":40,"tags":309},[199,40,161,310],"两数之和",{"category":40,"tags":312},[199,40,161,313],"双指针",{"category":40,"tags":315},[199,40,161,178],{"category":40,"tags":317},[199,40,161,175],{"category":40,"tags":319},[199,40,161,320],"回溯",{"category":5,"tags":322},[323,324,325,326],"分布式处理与计算","Spark","Scala","RDD",{"category":5,"tags":328},[323,329,330,331],"线性回归","逻辑回归","监督学习",{"category":5,"tags":333},[323,334,335,336],"数值优化","牛顿法","收敛性",{"category":5,"tags":338},[323,339,340,341],"PCA","数据降维","正则化",{"category":5,"tags":343},[323,344,345,346],"聚类","层次聚类","K-Means",{"category":5,"tags":348},[323,349,350,351],"随机模拟","统计推断","EM算法",{"category":5,"tags":353},[24],{"category":5,"tags":355},[24],{"category":5,"tags":357},[24],{"category":40,"tags":359},[42,360],"图论",{"category":40,"tags":362},[42,363,364],"树","二叉树",{"category":40,"tags":366},[42,160],{"category":40,"tags":368},[42],{"category":40,"tags":370},[42,159],{"category":40,"tags":372},[42,40,373],"复杂度分析",{"category":40,"tags":375},[42,43,178],{"category":40,"tags":377},[42,43,188],{"category":40,"tags":379},[42,380],"基础概念",{"category":17,"tags":382},[383,384,385],"随记","照片","高中",{"category":17,"tags":387},[383,388,389],"团建","战地",{"category":17,"tags":391},[383,392],"生活",{"category":17,"tags":394},[383,395],"文学",{"category":17,"tags":397},[383,398,399],"SCP","模因",{"category":17,"tags":401},[383,402,403],"画集","艺术",{"category":17,"tags":405},[14,406,383],"写作",{"category":17,"tags":408},[383,409,410],"音乐","摇滚",{"category":17,"tags":412},[383,392],{"category":17,"tags":414},[383,409],{"category":17,"tags":416},[383,35,392],{"category":17,"tags":418},[383,419,420],"同人","手书",{"category":17,"tags":422},[383,392],{"category":17,"tags":424},[383,392],{"category":17,"tags":426},[383,427],"植物",{"category":17,"tags":429},[383,430],"读书",{"category":17,"tags":432},[383,392],{"category":17,"tags":434},[383,392],{"category":17,"tags":436},[383,392],{"category":17,"tags":438},[383,392],{"category":17,"tags":440},[383,392],{"category":17,"tags":442},[383,392],{"category":17,"tags":444},[14,445,383],"一周年",{"category":17,"tags":447},[383,392],{"category":17,"tags":449},[383,392],{"category":17,"tags":451},[35,452,453],"开源组织","SITE-193",{"category":17,"tags":455},[383,392],{"category":17,"tags":457},[383,458],"年末",{"category":17,"tags":460},[383,392],{"category":17,"tags":462},[383,392],{"category":17,"tags":464},[14,17],{"category":17,"tags":466},[383,392],{"category":17,"tags":468},[383,392],{"category":17,"tags":470},[383,392],{"category":17,"tags":472},[383,392],{"category":17,"tags":474},[383,475,476],"游戏","Control",{"category":30,"tags":478},[479,480,481,482],"Quadim","图像处理","四叉树","Rust",{"category":17,"tags":484},[14,485],"上线纪念",{"category":17,"tags":487},[383,395],{"category":30,"tags":489},[203,490],"测试",{"category":17,"tags":492},[383],{"category":17,"tags":494},[383,392],{"category":17,"tags":496},[383],{"category":5,"tags":498},[40],{"category":5,"tags":500},[40],{"category":5,"tags":502},[40],{"category":5,"tags":504},[40],{"category":5,"tags":506},[40],[508,512,516,520,524,528,532,536,540,544,548,552,556,560,564,568,572,576,579,583,587,590,594,598,602,606,610,614,618,622,626,630,634,638,642,646,650,654,658,662,666,670,674,678,682,686,690,694,698,702,706,710,714,718,722,726,730,734,738,742,746,750,754,758,762,766,770,774,778,782,786,790,794,798,801,805,809,813,817,821,825,829,833,837,841,845,849,853,857,861,865,869,873,877,881,885,889,893,897,901,904,907,911,915,919,923,927,930,934,938,942,946,950,954,957,961,965,969,973,977,981,984,988,992,996,1000,1004,1007,1011,1015,1019,1023,1027,1031,1035,1039,1043,1047,1051,1055,1059,1063,1067,1071,1075,1079],{"path":509,"words":510,"published":511,"date":156},"\u002Fposts\u002F2024\u002F2024-06-25-liteloaderqqnt",1296,"2024-06-25 11:03:08",{"path":513,"words":514,"published":515,"date":156},"\u002Fposts\u002F2024\u002F2024-06-26-ip签名",0,"2024-06-26 22:53:53",{"path":517,"words":518,"published":519,"date":156},"\u002Fposts\u002F2024\u002F2024-06-29-何加盐中文互联网正在加速崩塌",4853,"2024-06-29 00:47:13",{"path":521,"words":522,"published":523,"date":156},"\u002Fposts\u002F2024\u002F2024-07-12-github-chart",270,"2024-07-12 20:02:50",{"path":525,"words":526,"published":527,"date":156},"\u002Fposts\u002F2024\u002F2024-07-14-访客数统计",192,"2024-07-24 01:34:28",{"path":529,"words":530,"published":531,"date":156},"\u002Fposts\u002F2024\u002F2024-07-26-广大选课脚本",110,"2024-07-26 01:34:28",{"path":533,"words":534,"published":535,"date":156},"\u002Fposts\u002F2024\u002F2024-07-26-数学分析笔记其二",14,"2024-07-26 23:54:02",{"path":537,"words":538,"published":539,"date":156},"\u002Fposts\u002F2024\u002F2024-07-26-数据结构复习其二",12856,"2024-07-26 02:48:08",{"path":541,"words":542,"published":543,"date":156},"\u002Fposts\u002F2024\u002F2024-07-26-数据结构复习相关",32856,"2024-07-26 02:24:14",{"path":545,"words":546,"published":547,"date":156},"\u002Fposts\u002F2024\u002F2024-07-26-线性代数与空间解析几何知识点全汇总",6110,"2024-07-26 03:27:55",{"path":549,"words":550,"published":551,"date":156},"\u002Fposts\u002F2024\u002F2024-07-31-typora-picgo-兰空图床打造markdown写作环境",311,"2024-07-31 12:56:23",{"path":553,"words":554,"published":555,"date":156},"\u002Fposts\u002F2024\u002F2024-09-02-jupyter配置中文",441,"2024-09-02 23:49:05",{"path":557,"words":558,"published":559,"date":156},"\u002Fposts\u002F2024\u002F2024-09-02-自定义vscode背景图片",100,"2024-09-02 23:39:00",{"path":561,"words":562,"published":563,"date":156},"\u002Fposts\u002F2024\u002F2024-09-03-制作gzhu校园网路由器",1423,"2024-09-03 23:43:18",{"path":565,"words":566,"published":567,"date":156},"\u002Fposts\u002F2024\u002F2024-09-26-09-25-2024",136,"2024-09-26 00:49:26",{"path":569,"words":570,"published":571,"date":156},"\u002Fposts\u002F2024\u002F2024-11-04-创建一个网络包解码器分析devp2p协议",1943,"2024-11-04 16:45:19",{"path":573,"words":574,"published":575,"date":156},"\u002Fposts\u002F2024\u002F2025-03-09-2024一些笔记常微分",16,"2024-12-09 22:51:00",{"path":577,"words":574,"published":578,"date":156},"\u002Fposts\u002F2024\u002F2025-03-09-2024一些笔记概率论","2025-03-09 22:51:00",{"path":580,"words":581,"published":582,"date":156},"\u002Fposts\u002F2025\u002F2025-03-01-windows下释放docker占用的wsl空间",164,"2025-03-01 13:54:15",{"path":584,"words":585,"published":586,"date":156},"\u002Fposts\u002F2025\u002F2025-03-01-爬虫实战-爬取广州大学课程表",774,"2025-03-01 14:55:48",{"path":588,"words":530,"published":589,"date":156},"\u002Fposts\u002F2025\u002F2025-04-03-hexo集成gitalk的问题","2025-04-03 14:26:34",{"path":591,"words":592,"published":593,"date":156},"\u002Fposts\u002F2025\u002F2025-09-22-记一次配置obsidian配合hexo写博客",92,"2025-09-22 16:47:52",{"path":595,"words":596,"published":597,"date":156},"\u002Fposts\u002F2025\u002F2025-10-24-10-20课题",204,"2025-10-24 08:15:01",{"path":599,"words":600,"published":601,"date":156},"\u002Fposts\u002F2025\u002F2025-11-02-组会朝花夕拾",501,"2025-11-02 18:56:59",{"path":603,"words":604,"published":605,"date":156},"\u002Fposts\u002F2025\u002F2025-11-05-基于随机加权推断模型im的参数估计算法",481,"2025-11-05 20:51:41",{"path":607,"words":608,"published":609,"date":156},"\u002Fposts\u002F2025\u002F2025-11-09-关于软考高项网规",884,"2025-11-09 19:54:52",{"path":611,"words":612,"published":613,"date":156},"\u002Fposts\u002F2025\u002F2025-11-17-arch-linux运行appimage相关",365,"2025-11-17 09:59:59",{"path":615,"words":616,"published":617,"date":156},"\u002Fposts\u002F2025\u002F2025-11-19-相关概念",2058,"2025-11-19 11:06:20",{"path":619,"words":620,"published":621,"date":156},"\u002Fposts\u002F2025\u002F2025-11-21-web可视化实践canvas",6393,"2025-11-21 14:50:48",{"path":623,"words":624,"published":625,"date":156},"\u002Fposts\u002F2025\u002F2025-11-22-使用-github-actions-自动部署基于vite的项目到-github-pages",272,"2025-11-23 01:59:24",{"path":627,"words":628,"published":629,"date":156},"\u002Fposts\u002F2025\u002F2025-11-22-关于前端包管理器npmpnpmyarn和bun",4890,"2025-11-22 21:21:15",{"path":631,"words":632,"published":633,"date":156},"\u002Fposts\u002F2025\u002F2025-11-23-undo-redo-机制具体实现",7839,"2025-11-23 19:15:00",{"path":635,"words":636,"published":637,"date":156},"\u002Fposts\u002F2025\u002F2025-11-27-前端安全-关于xss与crsf",1866,"2025-11-28 02:05:25",{"path":639,"words":640,"published":641,"date":156},"\u002Fposts\u002F2025\u002F2025-12-05-现代协同-2d-画布编辑器pixijs-v8",4285,"2025-12-05 02:00:16",{"path":643,"words":644,"published":645,"date":156},"\u002Fposts\u002F2025\u002F2025-12-07-杂谈-课题组系统设计",3710,"2025-12-07 21:09:33",{"path":647,"words":648,"published":649,"date":156},"\u002Fposts\u002F2025\u002F2025-12-25-javascript中的数组方法与栈stack和队列queue的实现",474,"2025-11-29 16:58:15",{"path":651,"words":652,"published":653,"date":156},"\u002Fposts\u002F2025\u002F2025-12-25-关于javascript-实现哈希表",189,"2025-11-27 11:31:39",{"path":655,"words":656,"published":657,"date":156},"\u002Fposts\u002F2025\u002F2025-12-25-关于javascript的set方法",332,"2025-12-25 15:26:18",{"path":659,"words":660,"published":661,"date":156},"\u002Fposts\u002F2025\u002F2025-12-25-关于动态规划(背包问题为例)",1238,"2025-11-17 18:24:04",{"path":663,"words":664,"published":665,"date":156},"\u002Fposts\u002F2025\u002F2025-12-25-关于滑动窗口",712,"2025-11-20 15:04:40",{"path":667,"words":668,"published":669,"date":156},"\u002Fposts\u002F2025\u002F2025-12-25-关于链表(javascript)",500,"2025-11-25 13:00:48",{"path":671,"words":672,"published":673,"date":156},"\u002Fposts\u002F2025\u002F2025-12-25-面试算法acm模式构建构建输入输出模板",2051,"2025-12-25 23:09:45",{"path":675,"words":676,"published":677,"date":156},"\u002Fposts\u002F2025\u002F2025-12-26-javascript-数字数组字符串的处理",483,"2025-12-26 11:20:25",{"path":679,"words":680,"published":681,"date":156},"\u002Fposts\u002F2025\u002F2025-12-26-javascripttypescript-的顺序表链表实现",446,"2025-12-26 12:16:12",{"path":683,"words":684,"published":685,"date":156},"\u002Fposts\u002F2025\u002F2025-12-27-前端画布设计vol-1-实现基础yuan素渲染和状态控制",2136,"2025-12-28 01:23:08",{"path":687,"words":688,"published":689,"date":156},"\u002Fposts\u002F2025\u002F2025-12-27-前端画布设计vol-2-实现富文本编辑",1838,"2025-12-28 02:58:47",{"path":691,"words":692,"published":693,"date":156},"\u002Fposts\u002F2025\u002F2025-12-27-算法刷题-关于链表操作",2135,"2025-12-27 16:12:42",{"path":695,"words":696,"published":697,"date":156},"\u002Fposts\u002F2025\u002F2025-12-27-配置dnscrypt-proxy实现加密dns服务windows",1899,"2025-11-15 01:06:37",{"path":699,"words":700,"published":701,"date":156},"\u002Fposts\u002F2025\u002F2025-12-28-前端-关于网络请求xhrajaxfetchaxios",7788,"2025-10-28 15:48:46",{"path":703,"words":704,"published":705,"date":156},"\u002Fposts\u002F2025\u002F2025-12-28-前端-接口封装与请求规范axios为例",2373,"2025-12-29 01:01:18",{"path":707,"words":708,"published":709,"date":156},"\u002Fposts\u002F2025\u002F2025-12-28-前端-身份验证管理-基于-jwt-token-的实现",2709,"2025-11-23 22:04:41",{"path":711,"words":712,"published":713,"date":156},"\u002Fposts\u002F2025\u002F2025-12-29-记canvas画布项目开发",6254,"2025-12-29 04:52:15",{"path":715,"words":716,"published":717,"date":156},"\u002Fposts\u002F2025\u002Fabout-site",116,"2025-03-31 16:44:24",{"path":719,"words":720,"published":721,"date":156},"\u002Fposts\u002F2025\u002F使用neo4j图数据科学库gds进行中心度分析",143,"2025-04-02 23:37:24",{"path":723,"words":724,"published":725,"date":156},"\u002Fposts\u002F2026\u002F2026-01-03-论文实训草稿",10445,"2026-01-03 14:10:49",{"path":727,"words":728,"published":729,"date":156},"\u002Fposts\u002F2026\u002F2026-01-06-人工智能导论",11461,"2026-01-07 03:25:49",{"path":731,"words":732,"published":733,"date":156},"\u002Fposts\u002F2026\u002F2026-01-07-机器学习相关算法",82,"2026-01-08 02:28:13",{"path":735,"words":736,"published":737,"date":156},"\u002Fposts\u002F2026\u002F2026-01-16-关于低复杂度最长链共识算法设计",4466,"2026-01-16 10:33:23",{"path":739,"words":740,"published":741,"date":156},"\u002Fposts\u002F2026\u002F2026-01-19-杂记2026-01-19",5754,"2026-01-20 01:03:26",{"path":743,"words":744,"published":745,"date":156},"\u002Fposts\u002F2026\u002F2026-01-22-github-action-自动同步博客到-github-主页",1069,"2026-01-22 16:31:47",{"path":747,"words":748,"published":749,"date":156},"\u002Fposts\u002F2026\u002F2026-03-01-windows-wsl安装docker",257,"2026-03-01 20:55:31",{"path":751,"words":752,"published":753,"date":156},"\u002Fposts\u002F2026\u002F2026-03-14-关于-msys2",701,"2026-03-15 03:05:04",{"path":755,"words":756,"published":757,"date":156},"\u002Fposts\u002F2026\u002F2026-03-28-团队项目协作规范随记",2419,"2026-03-29 05:33:50",{"path":759,"words":760,"published":761,"date":156},"\u002Fposts\u002F2026\u002F2026-03-29-oh-my-posh配置分享",104,"2026-03-29 16:34:43",{"path":763,"words":764,"published":765,"date":156},"\u002Fposts\u002F2026\u002F2026-06-13-从上下文工程到-agent-harness-engineering",8840,"2026-06-13 21:06:20",{"path":767,"words":768,"published":769,"date":156},"\u002Fposts\u002F2026\u002F2026-07-13-简谈前端基建质量标准与ai友好建设",3814,"2026-07-13 21:06:20",{"path":771,"words":772,"published":773,"date":156},"\u002Fposts\u002F2026\u002F2026-07-15-agentic-rag-系统实践",13357,"2026-07-15 21:06:20",{"path":775,"words":776,"published":777,"date":156},"\u002Fposts\u002F2026\u002F2026-07-18-简谈sdd规范驱动开发-copy",4476,"2026-07-18 11:06:20",{"path":779,"words":780,"published":781,"date":156},"\u002Fposts\u002F2026\u002F2026-07-20-个人neovim配置分享",366,"2026-07-22 13:46:50",{"path":783,"words":784,"published":785,"date":156},"\u002Fposts\u002F2026\u002F2026-07-20-关于技术写作-设计文档",6763,"2026-07-20 13:46:50",{"path":787,"words":788,"published":789,"date":156},"\u002Fposts\u002F2026\u002F2026-07-29-fastapi-工程实践随记",3417,"2026-07-29 04:58:34",{"path":791,"words":792,"published":793,"date":156},"\u002Fposts\u002Frfc_agentic_project\u002F2026-06-19-rfc-liskin_code_agent",3563,"2026-06-19 15:18:20",{"path":795,"words":796,"published":797,"date":156},"\u002Fposts\u002Frfc_agentic_project\u002F2026-07-25-rfc-glushkov_ogas",13461,"2026-07-28 23:46:50",{"path":799,"words":800,"published":793,"date":156},"\u002Fposts\u002Frfc_agentic_project\u002F2026-08-03-adr-ogas-arkhiv",2698,{"path":802,"words":803,"published":804,"date":156},"\u002Fposts\u002Frfc_agentic_project\u002Frag\u002F2026-08-12-arkhiv_rag-vol-1",4366,"2026-08-12 15:18:20",{"path":806,"words":807,"published":808,"date":156},"\u002Fposts\u002Fleetcode\u002F2025-12-25-力扣百题速练javascripttypescriptvol-1",3108,"2025-12-25 13:57:08",{"path":810,"words":811,"published":812,"date":156},"\u002Fposts\u002Fleetcode\u002F2025-12-26-力扣百题速练javascripttypescriptvol-2",3185,"2025-12-26 13:57:08",{"path":814,"words":815,"published":816,"date":156},"\u002Fposts\u002Fleetcode\u002F2025-12-28-力扣百题速练javascripttypescriptvol-3",2533,"2025-12-29 02:15:44",{"path":818,"words":819,"published":820,"date":156},"\u002Fposts\u002Fleetcode\u002F2026-01-17-力扣百题速练javascripttypescriptvol-4",3024,"2026-01-17 22:53:01",{"path":822,"words":823,"published":824,"date":156},"\u002Fposts\u002Fleetcode\u002F2026-01-19-力扣百题速练javascripttypescriptvol-5",293,"2026-01-19 15:15:12",{"path":826,"words":827,"published":828,"date":156},"\u002Fposts\u002F分布式处理与计算\u002F分布式处理与计算spark系统与scala语言",4320,"2026-07-06 14:10:49",{"path":830,"words":831,"published":832,"date":156},"\u002Fposts\u002F分布式处理与计算\u002F分布式处理与计算分类与回归分析",2081,"2026-07-07 12:40:29",{"path":834,"words":835,"published":836,"date":156},"\u002Fposts\u002F分布式处理与计算\u002F分布式处理与计算数值优化方法",2182,"2026-07-07 13:50:29",{"path":838,"words":839,"published":840,"date":156},"\u002Fposts\u002F分布式处理与计算\u002F分布式处理与计算数据降维",1583,"2026-07-07 21:50:29",{"path":842,"words":843,"published":844,"date":156},"\u002Fposts\u002F分布式处理与计算\u002F分布式处理与计算聚类分析",1882,"2026-07-07 16:50:29",{"path":846,"words":847,"published":848,"date":156},"\u002Fposts\u002F分布式处理与计算\u002F分布式处理与计算随机模拟与统计推断",2433,"2026-07-06 22:40:29",{"path":850,"words":851,"published":852,"date":156},"\u002Fposts\u002F数据可视化\u002F2026-06-14-数据可视化-基本图像",10011,"2026-06-14 20:18:20",{"path":854,"words":855,"published":856,"date":156},"\u002Fposts\u002F数据可视化\u002F2026-06-14-数据可视化-概论",10030,"2026-06-14 15:18:20",{"path":858,"words":859,"published":860,"date":156},"\u002Fposts\u002F数据可视化\u002F2026-06-15-数据可视化-可视化库",2032,"2026-06-15 20:18:20",{"path":862,"words":863,"published":864,"date":156},"\u002Fposts\u002F数据结构\u002F2025-09-29-数据结构-图",5451,"2025-04-15 20:48:06",{"path":866,"words":867,"published":868,"date":156},"\u002Fposts\u002F数据结构\u002F2025-09-29-数据结构-树",4211,"2025-04-30 02:19:06",{"path":870,"words":871,"published":872,"date":156},"\u002Fposts\u002F数据结构\u002F2025-09-29-数据结构-队列",921,"2025-04-11 15:30:08",{"path":874,"words":875,"published":876,"date":156},"\u002Fposts\u002F数据结构\u002F关于数据结构的一些想法",456,"2025-04-04 19:13:49",{"path":878,"words":879,"published":880,"date":156},"\u002Fposts\u002F数据结构\u002F数据结构-栈",920,"2025-04-18 00:17:37",{"path":882,"words":883,"published":884,"date":156},"\u002Fposts\u002F数据结构\u002F数据结构-算法复杂度",2153,"2025-04-05 16:09:55",{"path":886,"words":887,"published":888,"date":156},"\u002Fposts\u002F数据结构\u002F数据结构-线性表链表",4572,"2025-04-06 00:24:40",{"path":890,"words":891,"published":892,"date":156},"\u002Fposts\u002F数据结构\u002F数据结构-线性表顺序表",4191,"2025-04-05 22:09:59",{"path":894,"words":895,"published":896,"date":156},"\u002Fposts\u002F数据结构\u002F数据结构-绪论",2881,"2025-04-05 11:31:22",{"path":898,"words":899,"published":156,"date":900},"\u002Fposts\u002F杂记\u002F2023-12-26-2023年12月26日",7,"2023-12-26 23:51:33",{"path":902,"words":899,"published":156,"date":903},"\u002Fposts\u002F杂记\u002F2024-01-01-2024团建","2024-01-01 01:51:27",{"path":905,"words":581,"published":156,"date":906},"\u002Fposts\u002F杂记\u002F2024-01-09-随记","2024-01-09 20:50:35",{"path":908,"words":909,"published":156,"date":910},"\u002Fposts\u002F杂记\u002F2024-03-12-花名",5275,"2024-03-12 16:04:23",{"path":912,"words":913,"published":156,"date":914},"\u002Fposts\u002F杂记\u002F2024-04-15-逆模因",1353,"2024-04-15 00:26:16",{"path":916,"words":917,"published":156,"date":918},"\u002Fposts\u002F杂记\u002F2024-05-03-艺作",27,"2024-05-03 00:01:00",{"path":920,"words":921,"published":156,"date":922},"\u002Fposts\u002F杂记\u002F2024-05-21-关于博客",1720,"2024-02-21 23:21:11",{"path":924,"words":925,"published":156,"date":926},"\u002Fposts\u002F杂记\u002F2024-06-20-dnvrc维克多崔专访-2023",2036,"2024-06-20 00:28:39",{"path":928,"words":760,"published":156,"date":929},"\u002Fposts\u002F杂记\u002F2024-06-25-6月25日随记","2024-06-25 12:46:36",{"path":931,"words":932,"published":156,"date":933},"\u002Fposts\u002F杂记\u002F2024-06-25-歌名-想見星星",148,"2024-06-25 22:47:59",{"path":935,"words":936,"published":156,"date":937},"\u002Fposts\u002F杂记\u002F2024-07-11-桂花岗",6,"2024-07-11 00:28:17",{"path":939,"words":940,"published":156,"date":941},"\u002Fposts\u002F杂记\u002F2024-07-15-rolling-bocci",9,"2024-07-15 21:25:56",{"path":943,"words":944,"published":156,"date":945},"\u002Fposts\u002F杂记\u002F2024-07-22-七月九日",34,"2024-07-09 17:54:23",{"path":947,"words":948,"published":156,"date":949},"\u002Fposts\u002F杂记\u002F2024-07-22-六月随记",1052,"2024-07-22 01:03:19",{"path":951,"words":952,"published":156,"date":953},"\u002Fposts\u002F杂记\u002F2024-07-22-石菖蒲",41,"2024-07-10 01:26:05",{"path":955,"words":514,"published":156,"date":956},"\u002Fposts\u002F杂记\u002F2024-07-23-新书","2024-07-23 01:05:49",{"path":958,"words":959,"published":156,"date":960},"\u002Fposts\u002F杂记\u002F2024-07-29-年前",74,"2024-07-29 23:59:07",{"path":962,"words":963,"published":156,"date":964},"\u002Fposts\u002F杂记\u002F2024-07-30-周边",138,"2024-07-30 02:03:23",{"path":966,"words":967,"published":156,"date":968},"\u002Fposts\u002F杂记\u002F2024-07-31-2024-7-31日",185,"2024-07-31 01:21:52",{"path":970,"words":971,"published":156,"date":972},"\u002Fposts\u002F杂记\u002F2024-08-02-八月",1710,"2024-08-30 00:31:02",{"path":974,"words":975,"published":156,"date":976},"\u002Fposts\u002F杂记\u002F2024-09-01-九月",1484,"2024-09-26 16:30:15",{"path":978,"words":979,"published":156,"date":980},"\u002Fposts\u002F杂记\u002F2024-09-08-2024年9月8日",97,"2024-09-08 13:59:36",{"path":982,"words":514,"published":156,"date":983},"\u002Fposts\u002F杂记\u002F2024-09-19-博客站的一周年","2024-09-18 23:36:24",{"path":985,"words":986,"published":156,"date":987},"\u002Fposts\u002F杂记\u002F2024-10-03-十月",1028,"2024-10-31 23:54:27",{"path":989,"words":990,"published":156,"date":991},"\u002Fposts\u002F杂记\u002F2024-11-04-十一月",2134,"2024-11-30 00:04:39",{"path":993,"words":994,"published":156,"date":995},"\u002Fposts\u002F杂记\u002F2024-11-10-gzhu-site-193",80,"2024-11-10 19:19:12",{"path":997,"words":998,"published":156,"date":999},"\u002Fposts\u002F杂记\u002F2024-12-01-十二月",455,"2024-12-30 23:13:47",{"path":1001,"words":1002,"published":156,"date":1003},"\u002Fposts\u002F杂记\u002F2024-12-21-年末",23,"2024-12-21 23:21:49",{"path":1005,"words":522,"published":156,"date":1006},"\u002Fposts\u002F杂记\u002F2025-01-30-一月","2025-01-30 23:44:41",{"path":1008,"words":1009,"published":156,"date":1010},"\u002Fposts\u002F杂记\u002F2025-03-01-二月",224,"2025-02-28 00:11:08",{"path":1012,"words":1013,"published":156,"date":1014},"\u002Fposts\u002F杂记\u002F2025-03-01-博客杂谈",344,"2025-03-01 16:03:18",{"path":1016,"words":1017,"published":156,"date":1018},"\u002Fposts\u002F杂记\u002F2025-03-05-三月",2090,"2025-03-05 19:17:28",{"path":1020,"words":1021,"published":156,"date":1022},"\u002Fposts\u002F杂记\u002F2025-07-10-七月",361,"2025-07-10 22:04:32",{"path":1024,"words":1025,"published":156,"date":1026},"\u002Fposts\u002F杂记\u002F2025-09-21-九月",781,"2025-09-21 20:53:37",{"path":1028,"words":1029,"published":156,"date":1030},"\u002Fposts\u002F杂记\u002F2025-10-09-十月",591,"2025-10-09 00:35:07",{"path":1032,"words":1033,"published":156,"date":1034},"\u002Fposts\u002F杂记\u002Fcontrol",13,"2023-09-25 13:03:59",{"path":1036,"words":1037,"published":156,"date":1038},"\u002Fposts\u002F杂记\u002Fquadim四叉树图像处理",1094,"2023-10-21 11:27:06",{"path":1040,"words":1041,"published":156,"date":1042},"\u002Fposts\u002F杂记\u002Fsuccess",24,"2023-09-22 15:59:07",{"path":1044,"words":1045,"published":156,"date":1046},"\u002Fposts\u002F杂记\u002F三光年",295,"2023-11-18 04:18:40",{"path":1048,"words":1049,"published":156,"date":1050},"\u002Fposts\u002F杂记\u002F加密测试",961,"2023-11-21 14:24:01",{"path":1052,"words":1053,"published":156,"date":1054},"\u002Fposts\u002F杂记\u002F啊啊啊啊啊啊啊",54,"2023-09-20 17:29:33",{"path":1056,"words":1057,"published":156,"date":1058},"\u002Fposts\u002F杂记\u002F杂谈",124,"2023-09-25 23:11:32",{"path":1060,"words":1061,"published":156,"date":1062},"\u002Fposts\u002F杂记\u002F艹",25,"2023-10-21 17:40:43",{"path":1064,"words":1065,"published":1066,"date":156},"\u002Fposts\u002F神经网络\u002F神经网络与深度学习卷积神经网络",3168,"2026-06-07 11:23:08",{"path":1068,"words":1069,"published":1070,"date":156},"\u002Fposts\u002F神经网络\u002F神经网络与深度学习循环神经网络",2348,"2026-06-07 11:33:08",{"path":1072,"words":1073,"published":1074,"date":156},"\u002Fposts\u002F神经网络\u002F神经网络与深度学习改进学习方法",3360,"2026-06-07 10:13:08",{"path":1076,"words":1077,"published":1078,"date":156},"\u002Fposts\u002F神经网络\u002F神经网络与深度学习深度生成模型",2727,"2026-06-07 11:43:08",{"path":1080,"words":1081,"published":1082,"date":156},"\u002Fposts\u002F神经网络\u002F神经网络与深度学习神经网络基础",3205,"2026-06-07 10:03:08",{"id":1084,"title":1085,"abbrlink":1086,"body":1087,"category":5,"cover":156,"date":156,"description":1118,"extension":1510,"mathjax":1511,"meta":1512,"navigation":1511,"path":655,"published":657,"readingMinutes":1515,"seo":1516,"stem":1517,"sticky":156,"swiper_index":156,"tags":1518,"updated":156,"words":656,"__hash__":1519},"posts\u002Fposts\u002F2025\u002F2025-12-25-关于JavaScript的Set方法.md","2025-12-25-ES6-JavaScript的Set 方法","27040",{"type":1088,"value":1089,"toc":1459},"minimark",[1090,1095,1100,1111,1122,1126,1134,1140,1147,1153,1160,1166,1173,1179,1183,1190,1196,1210,1216,1220,1224,1230,1234,1240,1244,1250,1254,1258,1264,1268,1274,1278,1284,1288,1294,1298,1304,1308,1312,1318,1322,1328,1332,1338,1342,1346,1352,1356,1362,1366,1372,1376,1382,1386,1390,1396,1400,1406,1410,1416,1420,1426,1429,1431,1434],[1091,1092,1094],"h1",{"id":1093},"javascript-set-方法详解","JavaScript Set 方法详解",[1096,1097,1099],"h2",{"id":1098},"_1-set-是什么","1. Set 是什么？",[1101,1102,1103,1106,1107,1110],"p",{},[1104,1105,168],"strong",{},"​ 是 ES6 引入的一种新的数据结构，它类似于数组，但",[1104,1108,1109],{},"成员的值都是唯一的","，没有重复的值。",[1112,1113,1119],"pre",{"className":1114,"code":1116,"language":1117,"meta":1118},[1115],"language-ts","\u002F\u002F 创建一个 Set\nconst mySet = new Set()\n\n\u002F\u002F 或者从数组创建\nconst setFromArray = new Set([1, 2, 3, 3, 4]) \u002F\u002F 会自动去重\nconsole.log(setFromArray) \u002F\u002F Set(4) {1, 2, 3, 4}\n","ts","",[1120,1121,1116],"code",{"__ignoreMap":1118},[1096,1123,1125],{"id":1124},"_2-set-的基本方法","2. Set 的基本方法",[1127,1128,1130,1131],"h3",{"id":1129},"_21-添加元素add","2.1 添加元素：",[1120,1132,1133],{},"add()",[1112,1135,1138],{"className":1136,"code":1137,"language":1117,"meta":1118},[1115],"const set = new Set()\n\n\u002F\u002F 添加单个元素\nset.add(1)\nset.add(2)\nset.add(2) \u002F\u002F 重复添加，不会被添加进去\n\n\u002F\u002F 链式调用\nset.add(3).add(4).add(5)\n\n\u002F\u002F 可以添加任意类型的值\nset.add('hello')\nset.add({ name: 'John' })\nset.add([1, 2, 3])\nset.add(NaN) \u002F\u002F NaN 在 Set 中也是唯一的\nset.add(NaN) \u002F\u002F 不会添加第二个 NaN\n\nconsole.log(set.size) \u002F\u002F 查看大小\n",[1120,1139,1137],{"__ignoreMap":1118},[1127,1141,1143,1144],{"id":1142},"_22-删除元素delete","2.2 删除元素：",[1120,1145,1146],{},"delete()",[1112,1148,1151],{"className":1149,"code":1150,"language":1117,"meta":1118},[1115],"const set = new Set([1, 2, 3, 4, 5])\n\n\u002F\u002F 删除指定值\nset.delete(3) \u002F\u002F 删除 3\nconsole.log(set) \u002F\u002F Set(4) {1, 2, 4, 5}\n\n\u002F\u002F 删除不存在的值返回 false\nconsole.log(set.delete(10)) \u002F\u002F false\n\n\u002F\u002F 删除对象引用需要相同的引用\nconst obj = { name: 'John' }\nset.add(obj)\nconsole.log(set.delete({ name: 'John' })) \u002F\u002F false，因为不是同一个引用\nconsole.log(set.delete(obj)) \u002F\u002F true，删除成功\n",[1120,1152,1150],{"__ignoreMap":1118},[1127,1154,1156,1157],{"id":1155},"_23-检查存在has","2.3 检查存在：",[1120,1158,1159],{},"has()",[1112,1161,1164],{"className":1162,"code":1163,"language":1117,"meta":1118},[1115],"const set = new Set([1, 2, 3, 4, 5])\n\nconsole.log(set.has(2)) \u002F\u002F true\nconsole.log(set.has(10)) \u002F\u002F false\n\n\u002F\u002F 对于 NaN，Set 能正确处理\nset.add(NaN)\nconsole.log(set.has(NaN)) \u002F\u002F true\n",[1120,1165,1163],{"__ignoreMap":1118},[1127,1167,1169,1170],{"id":1168},"_24-清空-setclear","2.4 清空 Set：",[1120,1171,1172],{},"clear()",[1112,1174,1177],{"className":1175,"code":1176,"language":1117,"meta":1118},[1115],"const set = new Set([1, 2, 3, 4, 5])\nconsole.log(set.size) \u002F\u002F 5\n\nset.clear()\nconsole.log(set.size) \u002F\u002F 0\nconsole.log(set) \u002F\u002F Set(0) {}\n",[1120,1178,1176],{"__ignoreMap":1118},[1096,1180,1182],{"id":1181},"_3-set-的遍历方法","3. Set 的遍历方法",[1127,1184,1186,1187],{"id":1185},"_31-foreach","3.1 ",[1120,1188,1189],{},"forEach()",[1112,1191,1194],{"className":1192,"code":1193,"language":1117,"meta":1118},[1115],"const set = new Set(['apple', 'banana', 'orange'])\n\n\u002F\u002F 遍历每个元素\nset.forEach((value, key, set) => {\n  \u002F\u002F Set 的 key 和 value 相同\n  console.log(`${key}: ${value}`)\n})\n\n\u002F\u002F 输出：\n\u002F\u002F apple: apple\n\u002F\u002F banana: banana\n\u002F\u002F orange: orange\n",[1120,1195,1193],{"__ignoreMap":1118},[1127,1197,1199,1200,1203,1204,1203,1207],{"id":1198},"_32-keysvaluesentries","3.2 ",[1120,1201,1202],{},"keys()","、",[1120,1205,1206],{},"values()",[1120,1208,1209],{},"entries()",[1112,1211,1214],{"className":1212,"code":1213,"language":1117,"meta":1118},[1115],"const set = new Set(['a', 'b', 'c'])\n\n\u002F\u002F keys() - 返回键名的遍历器\nfor (let key of set.keys()) {\n  console.log(key) \u002F\u002F a, b, c\n}\n\n\u002F\u002F values() - 返回键值的遍历器（Set 的键和值相同）\nfor (let value of set.values()) {\n  console.log(value) \u002F\u002F a, b, c\n}\n\n\u002F\u002F entries() - 返回键值对的遍历器\nfor (let entry of set.entries()) {\n  console.log(entry) \u002F\u002F ['a', 'a'], ['b', 'b'], ['c', 'c']\n}\n",[1120,1215,1213],{"__ignoreMap":1118},[1096,1217,1219],{"id":1218},"_4-set-的特性","4. Set 的特性",[1127,1221,1223],{"id":1222},"_41-唯一性","4.1 唯一性",[1112,1225,1228],{"className":1226,"code":1227,"language":1117,"meta":1118},[1115],"\u002F\u002F 自动去重\nconst arr = [1, 2, 2, 3, 3, 3, 4, 5]\nconst uniqueSet = new Set(arr)\nconsole.log([...uniqueSet]) \u002F\u002F [1, 2, 3, 4, 5]\n\n\u002F\u002F 对象引用不同，不算重复\nconst obj1 = { id: 1 }\nconst obj2 = { id: 1 }\nconst objSet = new Set([obj1, obj2, obj1])\nconsole.log(objSet.size) \u002F\u002F 2，obj1 和 obj2 被认为是不同的\n",[1120,1229,1227],{"__ignoreMap":1118},[1127,1231,1233],{"id":1232},"_42-与数组的对比","4.2 与数组的对比",[1112,1235,1238],{"className":1236,"code":1237,"language":1117,"meta":1118},[1115],"\u002F\u002F 查找元素\nconst arr = [1, 2, 3, 4, 5]\nconst set = new Set(arr)\n\n\u002F\u002F 数组查找是 O(n)\nconsole.log(arr.includes(3)) \u002F\u002F true，需要遍历\n\n\u002F\u002F Set 查找是 O(1)\nconsole.log(set.has(3)) \u002F\u002F true，哈希查找，更快\n\n\u002F\u002F 判断是否重复\nconst hasDuplicates = (array) => {\n  return new Set(array).size !== array.length\n}\n\nconsole.log(hasDuplicates([1, 2, 3, 3])) \u002F\u002F true\nconsole.log(hasDuplicates([1, 2, 3, 4])) \u002F\u002F false\n",[1120,1239,1237],{"__ignoreMap":1118},[1127,1241,1243],{"id":1242},"_43-迭代顺序","4.3 迭代顺序",[1112,1245,1248],{"className":1246,"code":1247,"language":1117,"meta":1118},[1115],"\u002F\u002F Set 的遍历顺序就是插入顺序\nconst set = new Set()\nset.add(3)\nset.add(1)\nset.add(2)\n\nfor (let item of set) {\n  console.log(item) \u002F\u002F 3, 1, 2（插入顺序）\n}\n\n\u002F\u002F 与对象不同，对象的键顺序不保证\nconst obj = { 3: 'a', 1: 'b', 2: 'c' }\nconsole.log(Object.keys(obj)) \u002F\u002F ['1', '2', '3']（数字键会排序）\n",[1120,1249,1247],{"__ignoreMap":1118},[1096,1251,1253],{"id":1252},"_5-实际应用场景","5. 实际应用场景",[1127,1255,1257],{"id":1256},"_51-数组去重最常用","5.1 数组去重（最常用）",[1112,1259,1262],{"className":1260,"code":1261,"language":1117,"meta":1118},[1115],"\u002F\u002F 传统方法\nfunction uniqueArray(arr) {\n  return [...new Set(arr)]\n}\n\n\u002F\u002F 使用\nconst numbers = [1, 2, 3, 3, 4, 4, 5]\nconsole.log(uniqueArray(numbers)) \u002F\u002F [1, 2, 3, 4, 5]\n\n\u002F\u002F 字符串去重\nconst str = 'hello world'\nconst uniqueChars = [...new Set(str)].join('')\nconsole.log(uniqueChars) \u002F\u002F 'helo wrd'\n",[1120,1263,1261],{"__ignoreMap":1118},[1127,1265,1267],{"id":1266},"_52-求交集并集差集","5.2 求交集、并集、差集",[1112,1269,1272],{"className":1270,"code":1271,"language":1117,"meta":1118},[1115],"const setA = new Set([1, 2, 3, 4])\nconst setB = new Set([3, 4, 5, 6])\n\n\u002F\u002F 并集\nconst union = new Set([...setA, ...setB])\nconsole.log([...union]) \u002F\u002F [1, 2, 3, 4, 5, 6]\n\n\u002F\u002F 交集\nconst intersection = new Set([...setA].filter((x) => setB.has(x)))\nconsole.log([...intersection]) \u002F\u002F [3, 4]\n\n\u002F\u002F 差集（A 有 B 没有）\nconst difference = new Set([...setA].filter((x) => !setB.has(x)))\nconsole.log([...difference]) \u002F\u002F [1, 2]\n",[1120,1273,1271],{"__ignoreMap":1118},[1127,1275,1277],{"id":1276},"_53-数据筛选","5.3 数据筛选",[1112,1279,1282],{"className":1280,"code":1281,"language":1117,"meta":1118},[1115],"\u002F\u002F 从数组中过滤出唯一的元素\nconst data = [\n  { id: 1, name: 'Alice' },\n  { id: 2, name: 'Bob' },\n  { id: 1, name: 'Alice' }, \u002F\u002F 重复\n  { id: 3, name: 'Charlie' },\n]\n\n\u002F\u002F 基于 id 去重\nconst seen = new Set()\nconst uniqueData = data.filter((item) => {\n  if (seen.has(item.id)) {\n    return false\n  } else {\n    seen.add(item.id)\n    return true\n  }\n})\n\nconsole.log(uniqueData)\n\u002F\u002F [\n\u002F\u002F     { id: 1, name: 'Alice' },\n\u002F\u002F     { id: 2, name: 'Bob' },\n\u002F\u002F     { id: 3, name: 'Charlie' }\n\u002F\u002F ]\n",[1120,1283,1281],{"__ignoreMap":1118},[1127,1285,1287],{"id":1286},"_54-标签分类系统","5.4 标签\u002F分类系统",[1112,1289,1292],{"className":1290,"code":1291,"language":1117,"meta":1118},[1115],"class TagSystem {\n  constructor() {\n    this.tags = new Set()\n  }\n\n  addTag(tag) {\n    this.tags.add(tag.toLowerCase())\n    return this\n  }\n\n  removeTag(tag) {\n    this.tags.delete(tag.toLowerCase())\n    return this\n  }\n\n  hasTag(tag) {\n    return this.tags.has(tag.toLowerCase())\n  }\n\n  getAllTags() {\n    return [...this.tags]\n  }\n\n  merge(otherTagSystem) {\n    otherTagSystem.tags.forEach((tag) => this.tags.add(tag))\n    return this\n  }\n}\n\n\u002F\u002F 使用\nconst articleTags = new TagSystem()\narticleTags.addTag('JavaScript').addTag('Tutorial').addTag('JavaScript') \u002F\u002F 不会重复添加\n\nconsole.log(articleTags.getAllTags()) \u002F\u002F ['javascript', 'tutorial']\n",[1120,1293,1291],{"__ignoreMap":1118},[1096,1295,1297],{"id":1296},"_6-set-性能优势","6. Set 性能优势",[1112,1299,1302],{"className":1300,"code":1301,"language":1117,"meta":1118},[1115],"\u002F\u002F 测试查找性能\nconst largeArray = Array.from({ length: 1000000 }, (_, i) => i)\nconst largeSet = new Set(largeArray)\n\nconsole.time('Array查找')\nlargeArray.includes(999999)\nconsole.timeEnd('Array查找') \u002F\u002F 约 0.5-1ms\n\nconsole.time('Set查找')\nlargeSet.has(999999)\nconsole.timeEnd('Set查找') \u002F\u002F 约 0.01ms\n\n\u002F\u002F 测试重复检查性能\nconst checkDuplicatesArray = (arr) => {\n  for (let i = 0; i \u003C arr.length; i++) {\n    for (let j = i + 1; j \u003C arr.length; j++) {\n      if (arr[i] === arr[j]) return true\n    }\n  }\n  return false\n}\n\nconst checkDuplicatesSet = (arr) => {\n  return new Set(arr).size !== arr.length\n}\n\nconst testArray = Array.from({ length: 10000 }, () => Math.floor(Math.random() * 1000))\n\nconsole.time('数组检查重复')\ncheckDuplicatesArray(testArray)\nconsole.timeEnd('数组检查重复') \u002F\u002F 慢\n\nconsole.time('Set检查重复')\ncheckDuplicatesSet(testArray)\nconsole.timeEnd('Set检查重复') \u002F\u002F 快\n",[1120,1303,1301],{"__ignoreMap":1118},[1096,1305,1307],{"id":1306},"_7-weakset","7. WeakSet",[1127,1309,1311],{"id":1310},"_71-与-set-的区别","7.1 与 Set 的区别",[1112,1313,1316],{"className":1314,"code":1315,"language":1117,"meta":1118},[1115],"\u002F\u002F Set 可以存储任何类型的值\nconst set = new Set()\nlet obj = { name: 'John' }\nset.add(obj)\nconsole.log(set.size) \u002F\u002F 1\n\n\u002F\u002F WeakSet 只能存储对象引用\nconst weakSet = new WeakSet()\nweakSet.add(obj) \u002F\u002F OK\n\u002F\u002F weakSet.add(1); \u002F\u002F TypeError: Invalid value used in weak set\n\n\u002F\u002F WeakSet 的引用是弱引用，不会阻止垃圾回收\nobj = null \u002F\u002F 清除引用\n\u002F\u002F 等待垃圾回收后，weakSet 中的对应项会自动被移除\n",[1120,1317,1315],{"__ignoreMap":1118},[1127,1319,1321],{"id":1320},"_72-weakset-的方法","7.2 WeakSet 的方法",[1112,1323,1326],{"className":1324,"code":1325,"language":1117,"meta":1118},[1115],"const weakSet = new WeakSet()\nconst obj1 = {}\nconst obj2 = {}\n\nweakSet.add(obj1)\nweakSet.add(obj2)\n\nconsole.log(weakSet.has(obj1)) \u002F\u002F true\nweakSet.delete(obj1)\nconsole.log(weakSet.has(obj1)) \u002F\u002F false\n\n\u002F\u002F WeakSet 没有 size 属性，不能遍历\n\u002F\u002F console.log(weakSet.size); \u002F\u002F undefined\n\u002F\u002F weakSet.forEach(...) \u002F\u002F 没有 forEach 方法\n",[1120,1327,1325],{"__ignoreMap":1118},[1127,1329,1331],{"id":1330},"_73-weakset-的应用场景","7.3 WeakSet 的应用场景",[1112,1333,1336],{"className":1334,"code":1335,"language":1117,"meta":1118},[1115],"\u002F\u002F 1. 存储 DOM 节点，避免内存泄漏\nconst weakSet = new WeakSet()\n\ndocument.querySelectorAll('button').forEach((button) => {\n  weakSet.add(button)\n  button.addEventListener('click', () => {\n    if (weakSet.has(button)) {\n      console.log('按钮在集合中')\n    }\n  })\n})\n\n\u002F\u002F 当按钮从 DOM 中移除时，会被自动垃圾回收\n\u002F\u002F weakSet 中的引用也会自动移除\n\n\u002F\u002F 2. 私有属性模拟\nconst privateData = new WeakSet()\n\nclass User {\n  constructor(name) {\n    this.name = name\n    privateData.add(this) \u002F\u002F 标记为\"初始化\"\n  }\n\n  isInitialized() {\n    return privateData.has(this)\n  }\n}\n\nconst user = new User('Alice')\nconsole.log(user.isInitialized()) \u002F\u002F true\n",[1120,1337,1335],{"__ignoreMap":1118},[1096,1339,1341],{"id":1340},"_8-常见的一些陷阱和注意事项","8. 常见的一些陷阱和注意事项",[1127,1343,1345],{"id":1344},"_81-nan-的处理","8.1 NaN 的处理",[1112,1347,1350],{"className":1348,"code":1349,"language":1117,"meta":1118},[1115],"const set = new Set()\nset.add(NaN)\nconsole.log(set.has(NaN)) \u002F\u002F true\n\n\u002F\u002F 注意：NaN === NaN 为 false，但 Set 认为 NaN 等于自身\n",[1120,1351,1349],{"__ignoreMap":1118},[1127,1353,1355],{"id":1354},"_82-对象引用","8.2 对象引用",[1112,1357,1360],{"className":1358,"code":1359,"language":1117,"meta":1118},[1115],"const set = new Set()\nconst obj1 = { id: 1 }\nconst obj2 = { id: 1 }\n\nset.add(obj1)\nset.add(obj2)\n\nconsole.log(set.size) \u002F\u002F 2，因为 obj1 和 obj2 是不同的对象引用\nconsole.log(set.has({ id: 1 })) \u002F\u002F false，新对象不是同一个引用\n",[1120,1361,1359],{"__ignoreMap":1118},[1127,1363,1365],{"id":1364},"_83-类型转换","8.3 类型转换",[1112,1367,1370],{"className":1368,"code":1369,"language":1117,"meta":1118},[1115],"const set = new Set()\nset.add(1)\nset.add('1')\n\nconsole.log(set.size) \u002F\u002F 2，1 和 '1' 类型不同，不会去重\nconsole.log(set.has(1)) \u002F\u002F true\nconsole.log(set.has('1')) \u002F\u002F true\n",[1120,1371,1369],{"__ignoreMap":1118},[1127,1373,1375],{"id":1374},"_84-遍历时修改","8.4 遍历时修改",[1112,1377,1380],{"className":1378,"code":1379,"language":1117,"meta":1118},[1115],"const set = new Set([1, 2, 3])\n\n\u002F\u002F 在遍历时删除元素\nfor (let item of set) {\n  if (item === 2) {\n    set.delete(item) \u002F\u002F 当前正在遍历的元素可以安全删除\n  }\n  console.log(item) \u002F\u002F 1, 2, 3（会正常遍历完）\n}\n\n\u002F\u002F 在遍历时添加元素可能有问题\nfor (let item of set) {\n  if (item === 1) {\n    set.add(4) \u002F\u002F 添加的元素在本次遍历中可能不会被访问\n  }\n}\n",[1120,1381,1379],{"__ignoreMap":1118},[1096,1383,1385],{"id":1384},"_9-与其它数据结构的转换","9. 与其它数据结构的转换",[1127,1387,1389],{"id":1388},"_91-set-与-array","9.1 Set 与 Array",[1112,1391,1394],{"className":1392,"code":1393,"language":1117,"meta":1118},[1115],"\u002F\u002F Set → Array\nconst set = new Set([1, 2, 3])\nconst arr1 = Array.from(set)\nconst arr2 = [...set]\nconsole.log(arr1, arr2) \u002F\u002F [1, 2, 3]\n\n\u002F\u002F Array → Set\nconst array = [1, 2, 2, 3, 3, 3]\nconst newSet = new Set(array)\nconsole.log([...newSet]) \u002F\u002F [1, 2, 3]\n",[1120,1395,1393],{"__ignoreMap":1118},[1127,1397,1399],{"id":1398},"_92-set-与-string","9.2 Set 与 String",[1112,1401,1404],{"className":1402,"code":1403,"language":1117,"meta":1118},[1115],"\u002F\u002F 字符串去重并排序\nconst str = 'javascript'\nconst uniqueSorted = [...new Set(str)].sort().join('')\nconsole.log(uniqueSorted) \u002F\u002F 'aijprstv'\n",[1120,1405,1403],{"__ignoreMap":1118},[1127,1407,1409],{"id":1408},"_93-set-与-map","9.3 Set 与 Map",[1112,1411,1414],{"className":1412,"code":1413,"language":1117,"meta":1118},[1115],"\u002F\u002F 使用 Set 存储 Map 的键\nconst map = new Map([\n  ['a', 1],\n  ['b', 2],\n  ['c', 3],\n])\n\nconst keysSet = new Set(map.keys())\nconsole.log([...keysSet]) \u002F\u002F ['a', 'b', 'c']\n",[1120,1415,1413],{"__ignoreMap":1118},[1096,1417,1419],{"id":1418},"_10-综合示例","10. 综合示例",[1112,1421,1424],{"className":1422,"code":1423,"language":1117,"meta":1118},[1115],"\u002F\u002F 实现一个简单的权限系统\nclass PermissionSystem {\n  constructor() {\n    this.permissions = new Set()\n  }\n\n  \u002F\u002F 添加权限\n  addPermission(permission) {\n    this.permissions.add(permission)\n    return this\n  }\n\n  \u002F\u002F 批量添加权限\n  addPermissions(permissionsArray) {\n    permissionsArray.forEach((p) => this.permissions.add(p))\n    return this\n  }\n\n  \u002F\u002F 检查是否有某个权限\n  hasPermission(permission) {\n    return this.permissions.has(permission)\n  }\n\n  \u002F\u002F 检查是否有所有指定权限\n  hasAllPermissions(requiredPermissions) {\n    return requiredPermissions.every((p) => this.permissions.has(p))\n  }\n\n  \u002F\u002F 检查是否有任一指定权限\n  hasAnyPermission(permissions) {\n    return permissions.some((p) => this.permissions.has(p))\n  }\n\n  \u002F\u002F 获取所有权限\n  getAllPermissions() {\n    return [...this.permissions]\n  }\n\n  \u002F\u002F 移除权限\n  removePermission(permission) {\n    this.permissions.delete(permission)\n    return this\n  }\n\n  \u002F\u002F 清空所有权限\n  clearPermissions() {\n    this.permissions.clear()\n    return this\n  }\n}\n\n\u002F\u002F 使用示例\nconst userPermissions = new PermissionSystem()\nuserPermissions.addPermissions(['read', 'write', 'delete']).addPermission('execute')\n\nconsole.log(userPermissions.hasPermission('write')) \u002F\u002F true\nconsole.log(userPermissions.hasAllPermissions(['read', 'write'])) \u002F\u002F true\nconsole.log(userPermissions.getAllPermissions()) \u002F\u002F ['read', 'write', 'delete', 'execute']\n",[1120,1425,1423],{"__ignoreMap":1118},[1427,1428],"hr",{},[1427,1430],{},[1101,1432,1433],{},"总之",[1435,1436,1437,1444,1447,1450,1453,1456],"ul",{},[1438,1439,1440,1441,1443],"li",{},"高效查找：",[1120,1442,1159],{},"方法的时间复杂度是 O(1)",[1438,1445,1446],{},"遍历时按插入顺序输出",[1438,1448,1449],{},"需要去重时，优先考虑 Set",[1438,1451,1452],{},"需要快速查找元素是否存在时，用 Set 代替数组",[1438,1454,1455],{},"存储唯一值集合时，Set 是最佳选择",[1438,1457,1458],{},"需要存储对象引用并自动清理时，考虑 WeakSet",{"title":1118,"searchDepth":1460,"depth":1460,"links":1461},4,[1462,1464,1475,1481,1486,1492,1493,1498,1504,1509],{"id":1098,"depth":1463,"text":1099},2,{"id":1124,"depth":1463,"text":1125,"children":1465},[1466,1469,1471,1473],{"id":1129,"depth":1467,"text":1468},3,"2.1 添加元素：add()",{"id":1142,"depth":1467,"text":1470},"2.2 删除元素：delete()",{"id":1155,"depth":1467,"text":1472},"2.3 检查存在：has()",{"id":1168,"depth":1467,"text":1474},"2.4 清空 Set：clear()",{"id":1181,"depth":1463,"text":1182,"children":1476},[1477,1479],{"id":1185,"depth":1467,"text":1478},"3.1 forEach()",{"id":1198,"depth":1467,"text":1480},"3.2 keys()、values()、entries()",{"id":1218,"depth":1463,"text":1219,"children":1482},[1483,1484,1485],{"id":1222,"depth":1467,"text":1223},{"id":1232,"depth":1467,"text":1233},{"id":1242,"depth":1467,"text":1243},{"id":1252,"depth":1463,"text":1253,"children":1487},[1488,1489,1490,1491],{"id":1256,"depth":1467,"text":1257},{"id":1266,"depth":1467,"text":1267},{"id":1276,"depth":1467,"text":1277},{"id":1286,"depth":1467,"text":1287},{"id":1296,"depth":1463,"text":1297},{"id":1306,"depth":1463,"text":1307,"children":1494},[1495,1496,1497],{"id":1310,"depth":1467,"text":1311},{"id":1320,"depth":1467,"text":1321},{"id":1330,"depth":1467,"text":1331},{"id":1340,"depth":1463,"text":1341,"children":1499},[1500,1501,1502,1503],{"id":1344,"depth":1467,"text":1345},{"id":1354,"depth":1467,"text":1355},{"id":1364,"depth":1467,"text":1365},{"id":1374,"depth":1467,"text":1375},{"id":1384,"depth":1463,"text":1385,"children":1505},[1506,1507,1508],{"id":1388,"depth":1467,"text":1389},{"id":1398,"depth":1467,"text":1399},{"id":1408,"depth":1467,"text":1409},{"id":1418,"depth":1463,"text":1419},"md",true,{"uuid":1513,"slots":1514},"00d730c0-e163-11f0-a1ae-d9dba5bd8c7d",{},1,{"title":1085,"description":1118},"posts\u002F2025\u002F2025-12-25-关于JavaScript的Set方法",[167,161,168],"9efCKrMy5Xm8Y6HsDfvF1wHvFTCb0AUT3Jm_2BP5KKM",1790443287399]