Which of the following is a method to create an object in JavaScript?

  • Object.create()
  • new Object()
  • createObject()
  • initializeObject()
In JavaScript, you can create an object using the Object.create() method. This method allows you to specify the prototype object from which the new object should inherit properties and methods. The new Object() syntax is less commonly used for object creation.
Add your answer
Loading...

Leave a comment

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