Skip to content

Instantly share code, notes, and snippets.

@katelynsills
Created November 5, 2019 22:37
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 katelynsills/e5b7f66c1e14b61945cc08296bec662a to your computer and use it in GitHub Desktop.
Save katelynsills/e5b7f66c1e14b61945cc08296bec662a to your computer and use it in GitHub Desktop.
without method for Lists
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