Skip to content

Commit

Permalink
Promise Ex2
Browse files Browse the repository at this point in the history
  • Loading branch information
codingXpert committed Jun 26, 2022
1 parent c7a7aad commit 06d67a9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions promise2.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 = 'abc';

if(x === y){
resolve();
}else{
reject();
}

});

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

myPromise
.catch(() => {
console.log('Some error has occured');
});

0 comments on commit 06d67a9

Please sign in to comment.