Created
November 29, 2019 20:14
-
-
Save ahmetsonmez/a43308be54f05e36672aef79ae529a08 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
var promise = new Promise(function(resolve,reject){ | |
var total = sumNumbers(1,7); | |
if(total > 5){ | |
resolve(true); | |
} | |
else{ | |
reject(false); | |
} | |
}); | |
promise.then( | |
value => console.log("result : " + value), | |
error => console.log("Error : " + error) | |
); | |
function sumNumbers(num1=0,num2=0){ | |
return num1+num2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment