Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save himynameisdave/c246c4474e0c973af7b8875208eacdde to your computer and use it in GitHub Desktop.
Save himynameisdave/c246c4474e0c973af7b8875208eacdde to your computer and use it in GitHub Desktop.
Reduce your fears about .reduce() - twentySomethingsLongFullNames.js
const isInTwenties = user => user.age >= 20 && user.age < 30;
const makeFullName = user => `${user.firstName} ${user.lastName}`;
const isAtLeastTenChars = fullName => fullName.length >= 10;
const twentySomethingsLongFullNames = users.filter(isInTwenties)
.map(makeFullName)
.filter(isAtLeastTenChars);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment