> For the complete documentation index, see [llms.txt](https://strctr.gitbook.io/programming/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://strctr.gitbook.io/programming/01-languages/javascript/01-language/c-functions/c2-constructors.md). Agents can also search and read this documentation through its [MCP server](https://strctr.gitbook.io/programming/~gitbook/mcp).

# C2. Inheritance

There are several inheritance-related topics in JavaScript:

1. [Constructor functions](https://strctr.gitbook.io/programming/01-languages/javascript/01-language/c-functions/c2-constructors/01-constructor-function.md) - constructors as factories for instances, similar to classes in other languages.
2. [Constructor `prototype` property](https://strctr.gitbook.io/programming/01-languages/javascript/01-language/c-functions/c2-constructors/02-constructor-prototype.md) - prototypical inheritance.
3. [`constructor` property](https://strctr.gitbook.io/programming/01-languages/javascript/01-language/c-functions/c2-constructors/03-constructor-property.md) - reference to constructor function.
4. [`instanceof` operator](https://strctr.gitbook.io/programming/01-languages/javascript/01-language/c-functions/c2-constructors/04-instanceof-operator.md) - checking prototype chain.
5. [Enforce usage of `new`](https://strctr.gitbook.io/programming/01-languages/javascript/01-language/c-functions/c2-constructors/05-enforce-new.md) - how to guarantee that constructor function called with `new`.
