CodeBeginner

Constructor

Also known as class constructor

A function or class method used to initialize an object when an instance is created.

In the real world

class User { constructor(name) { this.name = name; } } initializes new User('Ada').

Related

Go a little deeper