在Javascript中,我可以通过以下方式获得Array对象的原型
var arr_prototype = Array.prototype
据我所知,这个Array.prototype
类似于OOP中的一个类。
在纯OOP语言中,Array
类可以从Iterable
类继承,Iterable
类可以从Object
类继承。
因此,我希望通过arr_prototype
表达式arr_prototype.prototype
来查看arr_prototype.prototype
的父类。
但是,它返回undefined
。有人对此有想法吗?
发布于 2015-11-05 03:02:53
Object.getPrototypeOf(arr_prototype );
prototype
属性不属于实例,它属于构造函数
https://stackoverflow.com/questions/33542841
复制相似问题