在Javascript中,我可以通过
获取Array对象的原型var arr_prototype = Array.prototype
据我了解,此Array.prototype
类似于OOP中的类。
在纯OOP语言中,Array
类可以继承自Iterable
类,Iterable
类可以继承自Object
类。
所以我希望通过eval表达式arr_prototype
看到arr_prototype.prototype
的父类。
但是,它会返回undefined
。有没有人有这方面的想法?
答案 0 :(得分:0)
Object.getPrototypeOf(arr_prototype );
prototype
属性不属于构造函数所属的实例