Skip to content

Instantly share code, notes, and snippets.

@netroy
Created July 15, 2014 13:39
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 netroy/38020bc18afca2a4ae2f to your computer and use it in GitHub Desktop.
Save netroy/38020bc18afca2a4ae2f to your computer and use it in GitHub Desktop.
How are these 2 any differrent ?
function Test (callback) {
try {
callback(null, doSomething())
} catch (e) {
callback(e);
}
}
function Test (callback) {
var result;
try {
result = doSomething();
} catch (e) {
callback(e);
return;
}
callback(null, result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment