Write a function ageDifference
that returns the difference in age between the oldest and youngest member of a family.
It should take two parameters: youngest
, and oldest
. These will always be objects. Use the following two as your test cases:
var youngest = {
name: 'Maya',
age: 13
};
var oldest = {
name: 'Joy',
age: 83
};
Successfully calling the function will look like this:
ageDifference(youngest, oldest); // ---> returns 70