var mString = new String('A');
console.log(typeof mString); // object
console.log(mString instanceof String); // true
console.log(mString instanceof Object); // true
console.log(mString.__proto__ === String.prototype); // true
console.log(mString.__proto__.__proto__ === Object.prototype); // true
Now, why
console.log(String.__proto__.__proto__ === Object.prototype); // true
and not
console.log(String.__proto__ === Object.prototype); // false
when walking up the prototype chain?
What is between String and Object prototypes?
Function.prototype === String.__proto__ //true
It's a function's prototype, because String is a constructor function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With