A detailed explanation of JavaScript's prototype-based inheritance system. Covers how objects get an implicit reference to their constructor's prototype property, how property lookup traverses the prototype chain, how to set up inheritance by assigning a parent instance to a child's prototype, and a common gotcha where the constructor property breaks during inheritance along with the fix.

7m read timeFrom beej.us
Post cover image

Sort: