0
Like why do we need to construct a constructor pls can anyone help
1 Odpowiedź
+ 2
Its more of a convenience, documentation and consistency thing. It helps structure your code meaning if you work with many objects and some need to have the same structure (same properties) its easier to remember if you have this object constructor function.
It makes those objects more defined.
This is especially helpful if you're not the only developer in your team and all of you require some of the same objects. So without these object constructors you might end up having objects that should represent the same but have differently named properties.