JavaScript | JavaScript OOP | Question 2

Last Updated :
Discuss
Comments

What is the purpose of the constructor method in a JavaScript class?

Initializes the class

Defines private methods

Creates a new instance of the class

Sets up properties for the class object

Share your thoughts in the comments