Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 610 Bytes

challenge01.md

File metadata and controls

25 lines (18 loc) · 610 Bytes

Challenge 1: Age Difference

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