Javascript中原型对象的原型(父类)?

时间:2015-11-05 10:59:03

标签: javascript oop prototype prototype-programming

在Javascript中,我可以通过

获取Array对象的原型
var arr_prototype = Array.prototype

据我了解,此Array.prototype类似于OOP中的类。

在纯OOP语言中,Array类可以继承自Iterable类,Iterable类可以继承自Object类。

所以我希望通过eval表达式arr_prototype看到arr_prototype.prototype的父类。

但是,它会返回undefined。有没有人有这方面的想法?

1 个答案:

答案 0 :(得分:0)

Object.getPrototypeOf(arr_prototype );

prototype属性不属于构造函数所属的实例