更新时间:2023-01-17 15:34:05
Douglas Crockford有一个解决方案以前我已经成功地解决了这个问题: Cycle.js
Douglas Crockford has a solution for this that I have successfully used to solve this problem before: Cycle.js
而不是使用 stringify
和 parse
c $ c> decycle 并使用 retrocycle
恢复
instead of just using stringify
and parse
you would first call decycle
and restore with retrocycle
var jsonString = JSON.stringify(JSON.decycle(parent));
var restoredObject = JSON.retrocycle(JSON.parse(jsonString));