The _______ keyword is used to define a constructor inside a class to create objects.

  • this
  • super
  • constructor
  • new
In JavaScript classes, the constructor keyword is used to define the constructor method. This constructor method is automatically called when you create a new object from the class. It is used to initialize the object's properties and perform any setup required.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *