-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

The TypeScript Workshop
By :

Before we build out our class, let's take a step back and understand how classes work. You can think of a class as a blueprint. It establishes a structure for what we want to build and has some behavior inside it. Now, the class by itself does nothing. It is simply a blueprint. In order to work with it, we have to perform a process called instantiation.
Instantiation is the process of taking a class and creating an actual object of the class that we can use. Let's walk through an example to understand instantiation further. Imagine that you're building a house and, like a good builder, you have a blueprint of what you want to build. That blueprint is like our class. The blueprint for a home is simply a set of rules, attributes, and behavior for a home. A blueprint for a house defines elements such as square footage, the number of rooms, the number of bathrooms, and where the plumbing goes. Technically, a blueprint is simply a set...