Open
Description
In Q31, we have
function Clone(object){
var newObject = {};
for(var key in object){
newObject[key] = object[key];
}
return newObject;
}
var objectLit = {foo : 'Bar'};
var cloneObj = Clone(obj); // Clone is the function which you have to write
console.log(cloneObj === Clone(objectLit)); // this should return false
console.log(cloneObj == Clone(objectLit)); // this should return true
-
where does the
obj
come from invar cloneObj = Clone(obj)
? -
should
A == B
be the same asA === B
when bothA
andB
are objects? why the last two lines have different outputs?
Thanks.
Metadata
Metadata
Assignees
Labels
No labels