While still struggling to read "You don't know JS", I am start to have good idea(love this series). I think I get the hang of prototype but I ran into below code.
var myObject = {
a:2
};
Object.getOwnPropertyDescriptor(myObject, "a");
And while I fully comprehend the output and its meaning, I was trying to use my understanding (or lack thereof) of prototype and wanted to do below.
myObject.getOwnPropertyDescriptor
I thought it would traverse up the proto chain up to Object's prototype and get that method but as it turns out, Object's prototype does not have this (assume this is not part of prototype of object as I am looking up the doc, at least I don't see it as part of prototype and it says it's a method). So instead of being Object.prototype.getOwnPropertyDescriptor, I assume this is just Object.getOwnPropertyDescriptor.
Am I understanding this correctly and what is the reason why Object's method is not on all prototype?