Skip to content

Instantly share code, notes, and snippets.

@felipepastorelima
Created April 23, 2018 22:44
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 felipepastorelima/9b3552b3d7948c291b1650b416299df1 to your computer and use it in GitHub Desktop.
Save felipepastorelima/9b3552b3d7948c291b1650b416299df1 to your computer and use it in GitHub Desktop.
Strategy - C
const seniorCandidatesRequirements = [
// ...
];
const candidates = [
// ...
];
function matchesEveryRequirement(candidates, requirements) {
if (!requirements) {
return [];
}
const filter = candidate => {
return requirements.every(requirement => requirement.matches(candidate));
};
return candidates.filter(filter);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment