added Kutya
This commit is contained in:
13
promise2.js
13
promise2.js
@@ -16,3 +16,16 @@ function asd(){
|
||||
}
|
||||
|
||||
asd();
|
||||
|
||||
|
||||
let newpromise = new Promise((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
if (true){
|
||||
resolve("OK");
|
||||
}
|
||||
reject("NOT OK");
|
||||
}, 2000);
|
||||
});
|
||||
|
||||
|
||||
newpromise.then(result => {console.log(result);}).catch(error => {console.log(error);});
|
||||
Reference in New Issue
Block a user