Skip to content

Instantly share code, notes, and snippets.

@calvinmetcalf
Created January 12, 2013 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calvinmetcalf/4519828 to your computer and use it in GitHub Desktop.
Save calvinmetcalf/4519828 to your computer and use it in GitHub Desktop.
//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