Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

return promise in node js

module.exports.getAllPosts = function()
{
    return new Promise((resolve,reject)=>{

        if(posts == true)
        {
          resolve("success");
        }else{
        reject("Failed");
        }
    });
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #return #promise #node #js
ADD COMMENT
Topic
Name
4+6 =