为什么js 的constructor中是无限循环嵌套:Foo.__proto__.constructor.prototype.constructor.prototype.constructor.prototype.xxx ?

constructor始终指向创建当前对象实例的(构造)函数。
任何函数都是Function类的一个实例
那么根据上述可知:任何函数的constructor属性都指向Function类,而Function类的constructor又指向谁呢?其实也是Function类本身,也就构成了一个递归。

posted on 2018-09-27 21:23  cag2050  阅读(641)  评论(0编辑  收藏  举报

导航