我能够将循环对象转换为 JSON。现在,我想将 JSON 转换为循环对象
//Cyclic to JSON conversion which works fine
<script>
var seatObj;
seen = [];
var replacer = function(key, value) {
if (value != null && typeof value == "object") {
if (seen.indexOf(value) >= 0) {
return;
}
seen.push(value);
}
return value;
};
seatObj = JSON.stringify(obj.part.data, replacer);
</script>