Created
November 5, 2019 22:37
-
-
Save katelynsills/e5b7f66c1e14b61945cc08296bec662a to your computer and use it in GitHub Desktop.
without method for Lists
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
function without(whole, part) { | |
insist(listExtentOps.includes(whole, part))`part is not in whole`; | |
const wholeMinusPart = []; | |
for (const wholeElement of whole) { | |
if (!includesElement(part, wholeElement)) { | |
wholeMinusPart.push(wholeElement); | |
} | |
} | |
return harden(wholeMinusPart); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment