You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// case 1, 自身有环constobj={foo: {bar:null}}obj.foo.bar=obj.foo// case 2, 互相引用constobj1={foo: {bar:null}}constobj2={baa: {caa:obj1.foo}}obj1.foo.bar=obj2.baaextend(true,obj1,obj2);
问题是什么
不能处理循环引用
环境
在线例子
其他
我试了下 jquery 也不能处理这种, 看了下他源码, 处理的方式和你是一样的, 能解释下为什么要这么处理吗,如果真有循环引用的话, 会一直不能
return target
,那么这个判断条件就一直是false
呀.The text was updated successfully, but these errors were encountered: