Introducing JavaScript objects overview.
#PROTOTYPE MODEL IN RES2DINV CODE#
Making decisions in your code - Conditionals.Basic math in JavaScript - Numbers and operators.Storing the information you need - Variables.
The prototype property's value is an object, which is basically a bucket for storing properties and methods that we want to be inherited by objects further down the prototype chain. Some are inherited, and some aren't - why is this?Īs mentioned above, the inherited ones are the ones defined on the prototype property (you could call it a sub-namespace) - that is, the ones that begin with Object.prototype., and not the ones that begin with just Object. So, where are the inherited properties and methods defined? If you look at the Object reference page, you'll see listed in the left hand side a large number of properties and methods - many more than the number of inherited members we saw available on the person1 object.