Skip to content

Instantly share code, notes, and snippets.

@aweary
Last active November 10, 2016 15:54
Show Gist options
  • Save aweary/b32ed12c829bcbc352ebb18f3641255c to your computer and use it in GitHub Desktop.
Save aweary/b32ed12c829bcbc352ebb18f3641255c to your computer and use it in GitHub Desktop.
Predicate logic in Javascript
const nand = (x, y) => !(x && y)
const not = (x) => nand(x, x)
const and = (x, y) => not(nand(x, y))
const or = (x, y) => nand(not(x), not(y))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment