Now that we have a new class, it's time to start differentiating instances. In this recipe, we'll see how to assign properties when instances are created, via constructor arguments.
Assigning properties with constructor arguments
Getting ready
This recipe assumes you already have a workspace that allows you to create and run ES modules in your browser. If you don't, please see the first two chapters.
How to do it...
- Open your command-line application and navigate to your workspace.
- Create a new folder named 07-02-assigning-constructor-props.
- Copy or create...