What does `Object.assign(target, source)` do?

JavaScript Associate Medium

JavaScript Associate — Medium

What does `Object.assign(target, source)` do?

Key points

  • Object.assign copies properties from source to target
  • Mutates the target object
  • Returns the mutated target object
  • Does not create a deep clone of the source object

Ready to go further?

Related questions