Recently I was going deep dive into the inheritance. As most of us know that almost every datatype is made of an Object, hence they will have access to the Object's prototype. I can check this by doing the following code.
"Mohit".__proto__.__proto__ === Object.prototype
return true;
This is perfectly fine. I know how this is working. But I was surprised when I saw this code.
console.log(String.__proto__)
prints => ƒ () { [native code] }
String.__proto__ === Array.__proto__
return true;
What is this? Why is it returning native function code? Why every dataType's class proto returns this native function code?