19 lines
407 B
JavaScript
19 lines
407 B
JavaScript
let batorzsido = false;
|
|
|
|
let myPromise = new Promise((resolve, reject) => {
|
|
setTimeout(() => {
|
|
if(batorzsido){
|
|
resolve("Ez a zsidó templomban is fingik");
|
|
}
|
|
reject("Ez a zsidó nem fingik a templomban");
|
|
}, 2000);
|
|
})
|
|
|
|
//setTimeout(asd, 3000);
|
|
|
|
function asd(){
|
|
myPromise.then(result => {console.log(result);}).catch(error => {console.log(error);});
|
|
}
|
|
|
|
asd();
|