ƒ Array()
arguments:(...)
caller:(...)
from:ƒ from()
isArray:ƒ isArray()
length:1
name:"Array"
of:ƒ of()
prototype:[constructor: ƒ, concat: ƒ, find: ƒ, findIndex: ƒ, pop: ƒ, …]
Symbol(Symbol.species):(...)
get Symbol(Symbol.species):ƒ [Symbol.species]()
__proto__:ƒ ()[[Scopes]]:Scopes[0]console.log(Array);
打印出的属性列表,请解释下prototype、__proto__和剩下其他属性的区别
另外添加属性的时候,使用Array.index = 1、Array.prototype.index = 1、Array.__proto__.index=1的区别
arguments:(...)
caller:(...)
from:ƒ from()
isArray:ƒ isArray()
length:1
name:"Array"
of:ƒ of()
prototype:[constructor: ƒ, concat: ƒ, find: ƒ, findIndex: ƒ, pop: ƒ, …]
Symbol(Symbol.species):(...)
get Symbol(Symbol.species):ƒ [Symbol.species]()
__proto__:ƒ ()[[Scopes]]:Scopes[0]console.log(Array);
打印出的属性列表,请解释下prototype、__proto__和剩下其他属性的区别
另外添加属性的时候,使用Array.index = 1、Array.prototype.index = 1、Array.__proto__.index=1的区别
Array.index = 1 类的静态属性
Array.prototype.index = 1 类的实例属性 所有new的对象共享
Array.__proto__.index=1 >>Array.constructor.prototype.index=1
Array.constructor==Function
所有function是Function的实例
所以 function f(){}
f.index==1