Skip to content

Instantly share code, notes, and snippets.

@richlloydmiles
Last active March 12, 2021 13:23
Show Gist options
  • Save richlloydmiles/e3af05a73b26a3cae0bf32afebef34f1 to your computer and use it in GitHub Desktop.
Save richlloydmiles/e3af05a73b26a3cae0bf32afebef34f1 to your computer and use it in GitHub Desktop.
Question 1
// nand (not and): if both values are 1 return 0, otherwise return 1
const nand = (a, b) => (a === 1 && b === 1 ? 0 : 1)
// using only the nand function (or multiple nand functions), write a new composite "and" function
// "and" function returns 1 if both are both 1 return 1, otherwise return 0
const and = (a, b) => {
// write your function here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment