We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c9926b9 commit 7470749Copy full SHA for 7470749
challenges/objects-challenges.md
@@ -96,10 +96,10 @@ function deepCopy(obj){
96
const copyObj = {};
97
for(const key in obj){
98
let val;
99
- if(obj[key] !== 'object')
100
- nVal[key] = obj[key];
+ if(typeof obj[key] !== 'object')
+ val = obj[key];
101
else
102
- copyObj[key] = deepCopy(obj[key]);
+ val = deepCopy(obj[key]);
103
104
copyObj[key] = val;
105
}
0 commit comments