Unite Family
Given three objects
SampleInput 1
{'surname' : 'Williams', 'city': 'Columbia'}
{'dish': 'cakes'}
{'pet': 'Rocky'}
Sample Output 1
Mr and Mrs Williams went to a picnic in Columbia with a boy and a pet Rocky. Mrs Williams made a special dish "cakes"
Sample Input 2
{'surname' : 'Jones', 'city': 'Los Angeles'}
{'dish': 'puddings'}
{'pet': 'Peter'}
Sample Output 2
Mr and Mrs Jones went to a picnic in Los Angeles with a boy and a pet Peter. Mrs Jones made a special dish "puddings"
function uniteFamily(father, mother, child) {
return `Mr and Mrs ${father['surname']} went to a picnic in ${father['city']} with a boy and a pet ${child['pet']}. Mrs ${father['surname']} made a special dish "${mother['dish']}"`
}
const res = uniteFamily({'surname' : 'Jones', 'city': 'Los Angeles'}, {'dish': 'puddings'}, {'pet': 'Peter'});
console.log(res);
Comments
Leave a comment