12 lines
244 B
JavaScript
12 lines
244 B
JavaScript
|
let condition = false;
|
||
|
|
||
|
|
||
|
let myPromise = new Promise((resolve, reject) => {
|
||
|
if (condition){
|
||
|
resolve("JÓÓÓ");
|
||
|
}
|
||
|
|
||
|
reject("szar");
|
||
|
});
|
||
|
|
||
|
myPromise.then((good) => {console.log(good)}).catch((error) =>{console.log(error)});
|