Constructors in JavaScript

  1. It creates a new empty object.
  2. Sets the value of this to be the new empty object(Whenever we refer to this keyword inside the class it is the new object that this just created.)
  3. It calls the constructor method(It allows us to add properties onto the object by creating this keyword which allows us to add, for example, this.location = or …

In Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store