-
-
Save gaurang847/527617922dc4872eb88555f1cf14c9bb 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 m1(){ | |
let a, b; | |
//Considering getValueFromFile1, getValueFromFile2 and getValueFromFile3 | |
//all return promises | |
return getValueFromFile1(); | |
.then(function(value){ | |
a = value; | |
return getValueFromFile2(); | |
}) | |
.then(function(value){ | |
b = value; | |
let sum = a + b; | |
return printSumToFile3(sum); | |
}) | |
.then(function(){ | |
console.log('Success'); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment