Created
July 30, 2021 17:03
-
-
Save alibalbars/6450592f8b2f5602734231de5bc2db81 to your computer and use it in GitHub Desktop.
Js Promise
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
let promise = new Promise(function (resolve, reject) { | |
resolve('basarili!'); | |
reject(new Error('hata alindi!')) | |
}) | |
promise.then( | |
function (result) { | |
console.log(result); | |
}, | |
function (error) { | |
console.log(error); | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment