Skip to content

Instantly share code, notes, and snippets.

@beaucharman
Last active February 4, 2019 02:01
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 beaucharman/fc2369f68ca1844437011011cd814047 to your computer and use it in GitHub Desktop.
Save beaucharman/fc2369f68ca1844437011011cd814047 to your computer and use it in GitHub Desktop.
A conditional higher order function
unless(booleanExpression, () => {
// Then callback
})
function unless(predicate, then) {
if (!predicate) {
then()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment