public
Created

  • Download Gist
callback.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
//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
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.