setTimeout( ()=>console.log(""), 1000);
function sayHello( arg ) {
return new Promise ( (resolve, reject) => {
if( arg === "success" ) {
for( var i=0; i< 1000; iPP) {
if(i===999)
resolve(i);
}
} else if( arg === "fail" ) {
reject("");
}
})
}
console.log("");
sayHello( "success" ).then( arg => {
console.log(arg)
})
I can"t quite understand this function all the time
if setTimeout has a shorter time setting, will it affect the for loop in Promise?
if setTimeout, is set, are the functions executed in this function executed concurrently?