delete objs in json
转自: 解决 TypeError: Converting circular structure to JSON - JSON.stringify 报错
let cache = []; // 去重数组
let json_str = JSON.stringify(hexo, function (key, value) {
if (typeof value === "object" && value !== null) {
if (cache.indexOf(value) !== -1) return;
cache.push(value);
}
return value;
});
cache = null; //释放cache
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 静谧之园!