Last active
May 31, 2016 03:17
-
-
Save joshuacerbito/5d98179c96c7635433cc2f0cee5c689e to your computer and use it in GitHub Desktop.
Performs a function unless the given expression is false
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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