The following are sample codes on how to merge properties of two JavaScript objects dynamically:
var objl = { food: var obj2 = { animal: "dog"}
Correct Answer:
Object.extend = function(destination., source) {
for (var property in source)
destination[property] = source[property];
return destination;
}
objl.extend(obj2)
Explanation:
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
More JavaScript MCQ Questions