When using the new keyword to create an object, what kind of function must you use?

  • Regular Function Declaration
  • Arrow Function
  • Constructor Function
  • Prototype Function
When using the new keyword to create an object, you must use a Constructor Function. Constructor functions are used to create and initialize objects. They are invoked with the new keyword and often set object properties and methods within the constructor. Arrow functions are not suitable because they don't have their own this context.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *