Javascript. Does it exists depth limit when object has reference to itself ? How does interpreter optimizes this case?

二次信任 提交于 2019-12-25 04:26:37

问题


If I understand correctly, in code below exists recursive reference:

var object = {}
object.nested = object;
console.log(object)

In console I can see infinite reference. So, how does interpreter optimizes this case ? How does this reference works ? Does it cause the memory leaks ? Does it exists depth limit ?

Plunker: http://plnkr.co/edit/QbR3o8cGnXU924nNs0cE

来源:https://stackoverflow.com/questions/40452539/javascript-does-it-exists-depth-limit-when-object-has-reference-to-itself-how

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!