内置构造函数的原型prototype

我们需要关注内置构造函数的prototype,

1、三个包装类对象

Number.prototype
Number {0, constructor: ƒ, toExponential: ƒ, toFixed: ƒ, toPrecision: ƒ, …}

String.prototype
String {"", constructor: ƒ, anchor: ƒ, big: ƒ, blink: ƒ, …}

Boolean.prototype
Boolean {false, constructor: ƒ, toString: ƒ, valueOf: ƒ}

2、数组

Array.prototype
[constructor: ƒ, concat: ƒ, copyWithin: ƒ, fill: ƒ, find: ƒ, …]

3、对象

Object.prototype
{constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …}

4、函数

Function.prototype
ƒ () { [native code] }

猜你喜欢

转载自blog.csdn.net/zyz00000000/article/details/106559385