Created
September 27, 2018 07:33
-
-
Save ahmeturganci/b6353069e4424f784b3a00494d2a53a9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| const sozVerdik = new Promise(function(resolve, reject){ | |
| if (herseyYolunda) { | |
| resolve('İşlem tamam!'); | |
| } else { | |
| reject('Bir sıkıntı var...'); | |
| } | |
| }) | |
| sozVerdik.then(function(cevap){ | |
| console.log(cevap) // 'İşlem tamam!' yazısını basar | |
| }).catch(function(hata){ | |
| console.log(hata) // 'Bir sıkıntı var...' yazısını basar | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment