Travis build: 1854

This commit is contained in:
30secondsofcode
2020-04-04 13:57:32 +00:00
parent 439b79832a
commit 09a8ba5219
12 changed files with 87 additions and 95 deletions

View File

@ -11,7 +11,6 @@ Use `Object.assign()` and an empty object (`{}`) to create a shallow clone of th
Use `Object.keys()` and `Array.prototype.forEach()` to determine which key-value pairs need to be deep cloned.
```js
const deepClone = obj => {
if (obj === null) return null;
let clone = Object.assign({}, obj);
@ -21,8 +20,8 @@ const deepClone = obj => {
return Array.isArray(obj) && obj.length
? (clone.length = obj.length) && Array.from(clone)
: Array.isArray(obj)
? Array.from(obj)
: clone;
? Array.from(obj)
: clone;
};
```