Skip to content

Instantly share code, notes, and snippets.

@JasonDeving
Created March 20, 2016 01:54
Show Gist options
  • Save JasonDeving/9c6bada527caf352929c to your computer and use it in GitHub Desktop.
Save JasonDeving/9c6bada527caf352929c to your computer and use it in GitHub Desktop.
callback
var ifElse = function(condition, isTrue, isFalse){
if(condition){
isTrue();
} else {
isFalse();
}
};
var logTrue = function(){ console.log(true); };
var logFalse = function(){ console.log(false); };
ifElse(true,logTrue,logFalse);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment