一种是eval(uneval(x)) == deep_copy_of_x . The actual method uneval(_obj_) is a Spidermonkey specific (as of 1.7) extension that is not part of ECMAScript.
另一种則是 for(i in..) traverse the properties and copy each of them.
本文介绍了两种实现深拷贝的方法:一是使用SpiderMonkey特有的uneval函数,这并非ECMAScript标准的一部分;二是通过遍历对象属性并逐个复制。
一种是eval(uneval(x)) == deep_copy_of_x . The actual method uneval(_obj_) is a Spidermonkey specific (as of 1.7) extension that is not part of ECMAScript.
另一种則是 for(i in..) traverse the properties and copy each of them.
426
349

被折叠的 条评论
为什么被折叠?