JavaScript: 使用 localStorage 和过滤操作优化关键字数据
let i = JSON.parse(localStorage.getItem("KeywordData")); i = i.filter(item => item.data.length != 0); i = i.map(item => { const subItem = i.find(subItem => subItem.name == item.name); if (subItem) { return subItem; } else { return item; } }); console.log(i);
原文地址: http://www.cveoy.top/t/topic/p56F 著作权归作者所有。请勿转载和采集!