-
-
Save netroy/38020bc18afca2a4ae2f to your computer and use it in GitHub Desktop.
How are these 2 any differrent ?
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
function Test (callback) { | |
try { | |
callback(null, doSomething()) | |
} catch (e) { | |
callback(e); | |
} | |
} | |
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
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