+ 1

Can someone explain how to use Object Constructor to create new object.

Javascript

24th Sep 2017, 5:28 PM
Ibrahim
Ibrahim - avatar
2 Antworten
+ 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
27th Sep 2017, 11:44 AM
jerom ronny
jerom ronny - avatar
+ 1
noted. thanks for your input
30th Sep 2017, 12:53 AM
Ibrahim
Ibrahim - avatar