对以下两个结果感到困惑

var str = "hello world";
console.log(str.__proto__ === String.prototype); // true
console.log(str instanceof String); // false

str表示此演示中的原始字符串。 现在为什么它的__proto__等于构造者的prototype
我想知道instanceof到底是什么意思?

machunhui1105 回答:对以下两个结果感到困惑

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2386704.html

大家都在问