Which method would you use to add a new property to an object after it has been created?

  • Object.add()
  • Object.append()
  • Object.assign()
  • Object.insert()
To add a new property to an existing object in JavaScript, you would typically use the Object.assign() method. This method allows you to merge properties from one or more source objects into a target object. It can be used to add or update properties in the target object.
Add your answer
Loading...

Leave a comment

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