promise 2
function mydisplay(mal){
console.log(mal)
}
const mypromic = new Promise(function executor(resolve,reject){
let x=0;
if (x==0){
resolve("okk")
}
else{
reject("not ok")
}
})
mypromic.then(
function one(value){
mydisplay(value);
}).catch(function two(err){
mydisplay(err);
}
)
Comments
Post a Comment