Created
July 3, 2021 19:35
-
-
Save mertcanaltin/4b1db1ce9c002cf845719d1a05428e1d 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 getComments = (number) => { | |
| return new Promise((resolve,reject) => { // resolve:işlem başarılı buyur datan , reject:bir problem oluştu ben bunu reddettim | |
| if(number === 1){ | |
| resolve({text:'selam'}); //number da döner obje de | |
| } | |
| reject('bir problem oldu'); | |
| }) | |
| } | |
| getComments(1) //getComments parametresi 1.satır | |
| .then((data) => console.log(data)) | |
| .catch(e => console.log(e)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment