wiki/content/20201113095244-object_assign.md

318 B

date id title
2020-11-13 b7bd3cef-b42a-4f96-8e4c-b0c75c1e86e3 Object.assign

Description

Object.assign copies all properties from one object into another

Syntax

let objectA = { a: 1, b: 2 };
Object.assign(objectA, { b: 3, c: 4 });
console.log(objectA);