Last active
July 26, 2020 16:23
-
-
Save sudomaxime/474a08d9a26ae72c9a3876a7f0bc58ee to your computer and use it in GitHub Desktop.
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
import * as vegetalLib from "some-weird-vegetal-lib"; | |
let eatable = [ | |
"banana", "apple", "watermelon", "tomato", "carrot", | |
"cucumber", "lettuce", "kiwi", "orange" | |
]; | |
function isWidelyAcceptedVegetable (eatable) { | |
let validLexically = vegetableLib.lexicalCheck(eatable); | |
let isTomato = vegetableLib.isTomato(eatable); | |
let debatable = vegetableLib.debatable(eatable); | |
if (!validLexically) return false; | |
if (isTomato && debatable) return false; | |
return true; | |
} | |
function findWidelyAcceptedVegetable (eatables) { | |
return eatables.filter(filterWidelyAcceptedVegetable); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment