Javascript uses prototypal inheritance which follows a slightly different pattern than that of a lanuage like Java or Python
Every object in JS has an implicit prototype attribute which is either null
or another object.
Prototypes are a form of optimisation in JS. If we know that we want to create 10 objects each of which have an identical function, rather than defining the same function 10 times, we can define it once in one object and use that object as a prototype for other objects.
You can chain prototypes, e.g. a prototype of an object can have its own prototype.
If you try and access a property which doesn’t exist on an object, it will be looked for in the prototype of that object, and so on up the prototype chain.