Created
January 12, 2013 18:38
-
-
Save calvinmetcalf/4519828 to your computer and use it in GitHub Desktop.
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
//if this is your callback | |
var callback = function(error,response){ | |
if(error){ | |
//code here would only run if error is truthy | |
}else{ | |
//this only runs if !error ==- true | |
} | |
} | |
//you can also write that as | |
var callbackDontCare = function(error,response){ | |
if(!error){ | |
//cone if there isn't an error | |
}else{ | |
handleError(error);//remember to define this | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment