Last active
April 4, 2021 09:36
-
-
Save disgusting-dev/09005774327714f64ba8d075efe9020b to your computer and use it in GitHub Desktop.
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 ignoringConditions = [ | |
() => false, | |
() => false, | |
() => false, | |
] | |
const hiringConditions = [ | |
() => true, | |
() => false, | |
() => false, | |
] | |
const mbConditions = [ | |
() => false, | |
() => false, | |
() => false, | |
] | |
const conditionsEnum = { | |
nope: ignoringConditions, | |
hire: hiringConditions, | |
maybe: mbConditions, | |
} | |
let result = ''; | |
for (let field in conditionsEnum) { | |
if (conditionsEnum[field].some(condition => !!condition())) { | |
result = field; | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment