简体   繁体   中英

The prototype (parent class) of a prototype object in Javascript?

In Javascript, I can obtain the prototype of Array object by

var arr_prototype = Array.prototype

As I understand, this Array.prototype is similar to a Class in OOP.

In a pure OOP language, the Array class may inherit from Iterable class, and Iterable class may inherit from Object class.

So I wish to see the parent class of arr_prototype by eval the expression arr_prototype.prototype .

However, it returns undefined . Does anyone have ideas about this?

Object.getPrototypeOf(arr_prototype );

prototype属性不属于实例,它属于构造函数

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM