Skip to content

Instantly share code, notes, and snippets.

@diorahman
Created September 16, 2016 07:16
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 diorahman/d07461316e811beca708ed5373337602 to your computer and use it in GitHub Desktop.
Save diorahman/d07461316e811beca708ed5373337602 to your computer and use it in GitHub Desktop.
function divide(a, b, cb) {
if (b === 0) {
return cb(new Error('Haha'));
}
cb(null, a/b);
}
divide((err, result) => {
if (err) {
throw err;
}
console.log('result', result);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment