Skip to content

Instantly share code, notes, and snippets.

@cptiwari20
Created May 12, 2019 12:28
Show Gist options
  • Select an option

  • Save cptiwari20/667cdedebdf22fe6a3d19d44f45d4653 to your computer and use it in GitHub Desktop.

Select an option

Save cptiwari20/667cdedebdf22fe6a3d19d44f45d4653 to your computer and use it in GitHub Desktop.
a JavaScript method receiving an array of objects containing name+age+gender, returning everyone between 30 and 40 years old grouped by gender.
//people array will be needed
function adultBw3040(peopleArray){
return peopleArray.filter(person => (person.age >= 30 ) && (person.age <= 40 ))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment