var str = "hello world";
console.log(str.__proto__ === String.prototype); // true
console.log(str instanceof String); // false
str表示此演示中的原始字符串。
现在为什么它的__proto__
等于构造者的prototype
?
我想知道instanceof
到底是什么意思?
var str = "hello world";
console.log(str.__proto__ === String.prototype); // true
console.log(str instanceof String); // false
str表示此演示中的原始字符串。
现在为什么它的__proto__
等于构造者的prototype
?
我想知道instanceof
到底是什么意思?