Created
April 23, 2018 22:42
-
-
Save felipepastorelima/0fe30350b6f0855ac0be23199773db4a to your computer and use it in GitHub Desktop.
Strategy - A
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
function selectSeniorCandidates(candidates) { | |
return candidates.filter(candidate => { | |
// with at least 5 years of experience that knows Javascript | |
return ( | |
candidate.yearsOfExperience >= 5 && | |
candidate.languages.includes('Javascript') | |
); | |
}); | |
} | |
const candidates = [ | |
{ | |
name: 'Jane', | |
yearsOfExperience: 6, | |
languages: ['Ruby', 'Javascript'] | |
}, | |
{ | |
name: 'John', | |
yearsOfExperience: 2, | |
languages: ['Java', 'Javascript', 'Ruby'] | |
} | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment