update snippets 0-All
This commit is contained in:
committed by
Agamemnon Zorbas
parent
39164e9cbf
commit
e7e687f60c
@ -6,9 +6,10 @@ Use `Object.assign()` and an empty object (`{}`) to create a shallow clone of th
|
||||
|
||||
```js
|
||||
const shallowClone = obj => Object.assign({}, obj);
|
||||
/*
|
||||
```
|
||||
|
||||
```js
|
||||
const a = { x: true, y: 1 };
|
||||
const b = shallowClone(a);
|
||||
a === b -> false
|
||||
*/
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user