search

Home  >  Q&A  >  body text

node.js promise not working - Stack Overflow

世界只因有你世界只因有你2750 days ago391

reply all(1)I'll reply

  • 阿神

    阿神2017-05-16 13:25:10

    function test(){

    var myFirstPromise = new Promise(function(resolve, reject){
         console.log('in promise')
        resolve("成功!"); //代码正常执行!
    });
    return myFirstPromise

    }

    test().then(function(successMessage){

    console.log("Yay! " + successMessage);

    });

    reply
    0
  • Cancelreply