Last active
May 20, 2017 21:30
-
-
Save himynameisdave/9c294762227ac92bfeec92b5b8c0e97c to your computer and use it in GitHub Desktop.
Reduce your fears about .reduce() - twentySomethingsLongFullNames-anonymous.js
This file contains 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 twentySomethingsLongFullNames = users | |
// First we filter only the users who are in their twenties | |
.filter(user => user.age >= 20 && user.age < 30) | |
// Combine first and last names | |
.map(user => `${user.firstName} ${user.lastName}`) | |
// Now remove any names that are 9 or less characters | |
.filter(fullName => fullName.length >= 10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment