Unite Family
Given three objects
Sample Input 1
{'surname' : 'Jones', 'city': 'Los Angeles'}
{'dish': 'puddings'}
{'pet': 'Peter'}
Sample Output 1
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"
Sample Input 2
{'surname' : 'Williams', 'city': 'Columbia'}
{'dish': 'cakes'}
{'pet': 'Rocky'}
Sample Output 2
Mr and Mrs Williams went to a picnic in Columbia with a boy and a pet Rocky. Mrs Williams made a special dish "cakes"
how it is possible these two out puts in console.log
function uniteFamily( father, mother, child ) {
console.log(`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}"`);
}
uniteFamily( {'surname' : 'Jones', 'city': 'Los Angeles'}, {'dish': 'puddings'}, {'pet': 'Peter'} )
uniteFamily( {'surname' : 'Williams', 'city': 'Columbia'}, {'dish': 'cakes'}, {'pet': 'Rocky'} )
Comments
Leave a comment