On Feb 28, 8:52 am, Julian Turner <[email protected]> wrote: [...] > 1. Inheritance in JavaScript is implemented through chains of > prototype objects, ending ultimately at Object.prototype.
Strictly, it ends with the object referenced by the internal [[prototype]] property of Object.prototype, which is null. > If you > access a property (including a property referencing a function - i.e. > a method) on an object, and the object does not have that property as > its own, then the interpreter will see if the the object's prototype > has that property, It uses the object referenced by an object's internal [[prototype]] property, which is (nearly always) a different object to that object's public prototype. > and if not whether that prototype's own prototype > has that property, and so on until it runs out at Object.prototype. The chain uses internal [[prototype]] properties, not public prototype properties. But I think you're on the right track, the OP's problem seems to be not understanding prototype inheritance. -- Rob -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
