;
+ return Array.isArray(obj) ? Array.from(clone) : clone;
};
const a = { foo: 'bar', obj: { a: 1, b: 2 } };
const b = deepClone(a);
diff --git a/snippets/deepClone.md b/snippets/deepClone.md
index de791ee7e..0b9e19497 100644
--- a/snippets/deepClone.md
+++ b/snippets/deepClone.md
@@ -7,8 +7,6 @@ Use `Object.assign()` and an empty object (`{}`) to create a shallow clone of th
Use `Object.keys()` and `Array.forEach()` to determine which key-value pairs need to be deep cloned.
```js
-
-
const deepClone = obj => {
let clone = Object.assign({}, obj);
Object.keys(clone).forEach(
@@ -19,10 +17,6 @@ const deepClone = obj => {
```
```js
-
-
-
-
const a = { foo: 'bar', obj: { a: 1, b: 2 } };
const b = deepClone(a); // a !== b, a.obj !== b.obj
```