use the following code for testing promise( I use BlueBird) and I've one Different question (the code is working)
assume that I want to remove the console.log from every function and I want in the then chain to get the value of return and print it to the console, how should I adopt the code?
var promise1 = function () {
setTimeout(function () {
//console.log("ret1") return "ret 1"; },
1000);
};
var promise2 = function () {
setTimeout(function () {
// console.log("ret2")
return "ret 2";
}, 2000);
};
var promise3 = function () {
setTimeout(function () {
//console.log("ret3");
return "ret 3";
}, 1000);
}
;
Promise.resolve()
.then(promise1)
.then(promise2)
.then(promise3)