Update shallow-clone-object.md
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
### Shallow clone object
|
### Shallow clone object
|
||||||
|
|
||||||
Use the object spread operator to spread the properties of the target object into the clone.
|
Use the object `...spread` operator to spread the properties of the target object into the clone.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const shallowClone = obj => ({ ...obj });
|
const shallowClone = obj => ({ ...obj });
|
||||||
|
|||||||
Reference in New Issue
Block a user