function testFunc() {
async.series([
function(down) {
setTimeout(function(){
down();
}, 10000);
}
],
function() {
return true;
});
};
if(testFunc()) console.log('Result function: true');
else console.log('Result function: false');
var testFunc=new Promise(function(resolve,reject){
setTimeout(function() {
//down();
resolve();
}, 10000);
});
testFunc.then(function(){
console.log('Result function: true');
},function(err){
console.log('Result function: false');
});
function testFunc(){
return new Promise(function(resolve,reject){
setTimeout(function() {
//down();
resolve();
}, 10000);
});
}
testFunc().then(function(){
console.log('Result function: true');
},function(err){
console.log('Result function: false');
});