Merge remote-tracking branch 'origin/master'

This commit is contained in:
Angelos Chalaris
2018-01-23 20:54:17 +02:00
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;
};