1.typeof
[/url]
console.log(
)
console.log(
undefined)
console.log(
[1, 2, 3])
console.log(
Boolean)
console.log(
1)
console.log(
‘1’)
console.log(
String)
console.log(
)
console.log(
)
console.lig(
symbol)
console.log(
Function)
[/url]
2.instanceof
The operatorThe prototype property of the constructor is used to check if it appears on the prototype chain of an instance object.
[/url]
console.log(
)
console.log(
undefined)
console.log(
[1, 2, 3])
console.log(
Boolean)
console.log(
1)
console.log(
‘1’)
console.log(
String)
console.log(
)
console.log(
)
console.lig(
symbol)
console.log(
Function)
[/url]
1. Display prototype: prototype
The constructorProperty that points to a pointer to the function of the Prototype property.
2. Implicit prototype: __proto__
3. Show the differences and connections between stereotypes and implicit stereotypes
P(){}let p1 =
P(); p1.__proto__ === P.prototype
P.prototype
P.prototype.constructor === P
P.__proto__ === Function.prototype
B(b){
.b = b; }
b =
B(‘seanxiao’)console.log(b)