Created
October 2, 2020 12:43
-
-
Save nsacerdote/3adf44697cd3eaad78334a68ea181a9f to your computer and use it in GitHub Desktop.
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 doSomething(input) { | |
if (!input) { | |
return Promise.reject('missing input'); // returns a rejected promise | |
} else { | |
return Promise.resolve(input + ' done'); // returns a fulfilled promise | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment