Skip to content

Instantly share code, notes, and snippets.

@richlloydmiles
Last active March 12, 2021 13:14
Show Gist options
  • Save richlloydmiles/a83a3ffc24dea92d4efafbdaa905d904 to your computer and use it in GitHub Desktop.
Save richlloydmiles/a83a3ffc24dea92d4efafbdaa905d904 to your computer and use it in GitHub Desktop.
Question 3
const people = {
adrian: {
age: 21,
department: 'design'
},
emma: {
age: 15,
department: 'development'
},
rachael: {
age: 18,
department: 'design'
},
john: {
age: 31,
department: 'development',
dependents: {
sven: {
age: 23,
department: 'design'
},
michael: {
age: 29,
department: 'development',
dependents: {
sharon: {
age: 20,
department: 'development'
}
}
}
}
}
}
// names of all the people and dependents with an age less than 30 who are in the development department as an array
// should output [ 'emma', 'michael', 'sharon' ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment