promise 1

 function mydisplay(mal){

    console.log(mal)
}


const mypromic = new Promise(function executor(resolve,reject){

    let x=2;

    if (x==0){
        resolve("okk")
    }
    else{
        reject("not ok")
    }

})

mypromic.then(
    function one(value){
        mydisplay(value);
    },
    function two(err){
        mydisplay(err);
    }
)

Comments

Popular posts from this blog

D WEB LINK