+ 1
Can someone explain how to use Object Constructor to create new object.
Javascript
2 Answers
+ 1
Constructors are like regular functions, but we use them with the "new" keyword. There are two types of constructors: native (aka built-in) constructors like Array and Object, which are available automatically in the execution environment at runtime; and custom constructors, which define properties and methods for your own type of object.
A constructor is useful when you want to create multiple similar objects with the same properties and methods. Itâs a convention to capitalize the name of constructors to distinguish them from regular functions
+ 1
noted. thanks for your input