Skip to content

Instantly share code, notes, and snippets.

@joshuacerbito
Last active May 31, 2016 03:17
Show Gist options
  • Save joshuacerbito/5d98179c96c7635433cc2f0cee5c689e to your computer and use it in GitHub Desktop.
Save joshuacerbito/5d98179c96c7635433cc2f0cee5c689e to your computer and use it in GitHub Desktop.
Performs a function unless the given expression is false
function unless(exp, func) {
if ( typeof func === 'function' && !exp ) {
func.apply(this, arguments);
}
return !exp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment