String
ƒ String() { [native code] }
String.prototype
String {’’, constructor: ƒ, anchor: ƒ, at: ƒ, big: ƒ, …}
String.proto
ƒ () { [native code] }
String.proto.proto
{constructor: ƒ, defineGetter: ƒ, defineSetter: ƒ, hasOwnProperty: ƒ, lookupGetter: ƒ, …}
so when i do
str.proto
it shows me
String {’’, constructor: ƒ, anchor: ƒ, at: ƒ, big: ƒ, …}
and when I do
str.__proto.__proto
it shows me
{constructor: ƒ, defineGetter: ƒ, defineSetter: ƒ, hasOwnProperty: ƒ, lookupGetter: ƒ, …}
but if I do
String.proto
it shows me
ƒ () { [native code] }
and not
{constructor: ƒ, defineGetter: ƒ, defineSetter: ƒ, hasOwnProperty: ƒ, lookupGetter: ƒ, …}
Why is that so?
because str inherits from the function String which in itself is an object and this String inherits from an empty object as Arnav mentioned
but then if i do
String.proto
i should get that empty object
but i get a function object
and when agaiin i do proto
only then it reaches that empty object
so when str.proto takes me to this String function object
then str.proto.proto should take me to this function ƒ () { [native code] }
but in this it doesnt happen
i am directly taken to that empty object
why is that so