Submodule 12.3: Constructor functions
- Introduction to Constructor
- Constructor syntax
- Methods inside Constructor Functions
- Adding Properties and Methods
Introduction to Constructor
This means that if we want to have more than one objects with the same properties and methods on a page, there is no easy way to achieve it.
The solution to the above comes with the usage of
With constructor functions, we can create as many replicates as we may need, without writing excess code.
For example, imagine that we want to create 1.000 cycles that are randomly moving ( we will learn how to do this in another submodule).
We only need one constructor function to achieve the same result.