Skip to content

Commit

Permalink
promise Ex3
Browse files Browse the repository at this point in the history
  • Loading branch information
codingXpert committed Jun 26, 2022
1 parent 06d67a9 commit dbdd62c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions promise3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
let myPromise = new Promise((resolve , reject) => {
const x = 'abc';
const y = 'xyz';

if(x === y){
resolve('problem Resolved');
}else{
reject('Some error has occured');
}

});

myPromise
.then((success) =>{
console.log(success);
});

myPromise
.catch((error) => {
console.log(error);
});

0 comments on commit dbdd62c

Please sign in to comment.