Skip to content

Instantly share code, notes, and snippets.

@sirjerky
Forked from hankyates/oldestLivingFather.js
Created April 15, 2014 02:53
Show Gist options
  • Save sirjerky/10698170 to your computer and use it in GitHub Desktop.
Save sirjerky/10698170 to your computer and use it in GitHub Desktop.
// Given the following data structure
// implement a oldestLivingFather method
// that will return the name of the oldest
// living father.
var people = [
{
name: 'Hank',
age: 29,
father: 'Don'
},
{
name: 'Deborah',
age: 30,
father: 'Don'
},
{
name: 'Danny',
age: 24,
father: 'Don'
},
{
name: 'Don',
age: 64,
father: 'Haskell'
},
{
name: 'Haskell',
father: 'Finus'
},
{
name: 'Finus'
}
]
oldestLivingFather(people);
// -> 'Don'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment