Created
May 2, 2019 10:58
-
-
Save hanwencheng/2e6c4cb43a68dbea8e381845b6bb7164 to your computer and use it in GitHub Desktop.
hot jar test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const result = people.reduce((acc, person)=>{ | |
if(person.age > 40 || person.age < 30) | |
return acc | |
acc[person.gender].push(person) | |
return acc; | |
}, {male :[], female:[]}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment