Travis build: 1350

This commit is contained in:
30secondsofcode
2018-01-23 18:50:30 +00:00
parent 4346b25279
commit 0a7797adda
3 changed files with 44 additions and 6 deletions

View File

@ -10,10 +10,7 @@ Use `Object.keys()` and `Array.forEach()` to determine which key-value pairs nee
const deepClone = obj => {
let clone = Object.assign({}, obj);
Object.keys(clone).forEach(
key =>
(clone[key] = typeof obj[key] === 'object'
? deepClone(obj[key])
: obj[key])
key => (clone[key] = typeof obj[key] === 'object' ? deepClone(obj[key]) : obj[key])
);
return clone;
};