JavaScript Constructor MethodLast Updated : 17 Mar 2025 A JavaScript constructor method is a special type of method which is used to initialize and create an object. It is called when memory is allocated for an object. Points to remember
Constructor Method ExampleLet's see a simple example of a constructor method. Output: 101 Martin Roy Constructor Method Example: super keywordThe super keyword is used to call the parent class constructor. Let's see an example. Output: 1 John Javatpoint Note - If we didn't specify any constructor method, JavaScript use default constructor method.Next TopicJS static Method |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India