Created
April 20, 2012 21:43
-
-
Save dawnerd/2432081 to your computer and use it in GitHub Desktop.
Simple If
This file contains hidden or 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 simpleIf(fun_if, fun_else) { | |
if(!fun_if()) fun_else(); | |
} | |
//usage | |
simpleIf(function(){ | |
console.log('doing stuff because Im true!'); | |
return true; | |
}, function(){ | |
console.log('some more stuff :('); | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment