Skip to content

Instantly share code, notes, and snippets.

@MarcoWorms
Last active April 5, 2018 09:50
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 MarcoWorms/b51fd9a6318827870cd59f7a7fb41333 to your computer and use it in GitHub Desktop.
Save MarcoWorms/b51fd9a6318827870cd59f7a7fb41333 to your computer and use it in GitHub Desktop.
const draw = (cardPicker, deck) => {
// 1. We want to know what card we drew
const card = cardPicker(deck)
// 2. We want the new deck without the drawn card
const newDeck = without(card, deck)
return { card, newDeck }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment