how it is possible two outputs(sample output 1, sample output 2) in this program
function uniteFamily( obj ) {
for ( key in obj ) {
console.log(key + ': ' + obj[key]);
}
}
let father = {
name: 'Bob',
age: 52
}
let mother = {
city: 'London'
}
let child = {
hobby: 'footbal'
}
uniteFamily( {...father, ...mother, ...child} )
Comments
Leave a comment