In JavaScript, Classes (or Class Constructor Functions) are functions that return objects, referred to as instances of that class. Class constructor functions promote well organized code as well as code reuse. Class constructor functions are frequenty called with the new
keyword which facilitates leveraging prototypal inheritance and the this
mechanism, both which support code reuse.
It is worth noting here that in the field of Computer Science, class has a formal definition which JavaScript not in fact adhere to. JavaScript programmers use the term out of familiarity with other languages, and because of similar observed behavior within their code. This is done in spite of the fact that in JavaScript they are doing something quite different than in other languages that adhere to the formal definiton.
After completing the reading and exercises in this repo you should be able to:
- Build Objects with Functions
- Share Properties with
__proto__
andprototype
- Use the
this
Mechanism to Interact with Instance Specific Properties from Shared Properties - Create Subclass Constructor Functions
- Refactor Class and Subclass Constructor functions to utilize ES6
class
syntax