wiki/content/20201113095244-object_assign.md

19 lines
316 B
Markdown
Raw Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-30 17:04:36 +00:00
date: 20201113
2024-05-06 20:40:05 +00:00
id: b7bd3cef-b42a-4f96-8e4c-b0c75c1e86e3
title: Object.assign
---
# Description
`Object.assign` copies all properties from one
[object](20200826201605-objects) into another
# Syntax
``` javascript
let objectA = { a: 1, b: 2 };
Object.assign(objectA, { b: 3, c: 4 });
console.log(objectA);
```