Skip to content

Instantly share code, notes, and snippets.

@hankyates
Last active August 29, 2015 13:57
Show Gist options
  • Save hankyates/9680467 to your computer and use it in GitHub Desktop.
Save hankyates/9680467 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'
},
{
name: 'Jeff',
age: 75,
father: 'Johnny'
}
]
oldestLivingFather(people);
// -> 'Don'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment