I've 3 functions, f1(), f2(),f3() like below,
function f1(){
setTimeout(function(){
console.log("Hi 1")
},3000);
}
function f2(){
setTimeout(function(){
console.log("Hi 2")
},2000);
}
function f3(){
setTimeout(function(){
console.log("Hi 3")
},1000);
}
f1();f2();f3();
when I execute this , I got result like Hi3, Hi2, Hi1, but what I expected result is Hi1, Hi2,Hi3. I try this using promise and callback functions, but I didn't resolve this, can any one help me how to do this. Thank you