+ 2
how do i console log "work1" in 3s , then "work2" in 3.5s ,then "work3" in 4.3s and console log done! with async/await..
Please i want to console log "work1" in 3s , console log "work2" in 3s + 500ms , console log "work3" in 3.5s + 800ms and console log "finished work" in the end using async/await in JavaScript...
3 Respostas
+ 2
var time = 0;
window.setInterval(function(){
time += 100;
(time === 3000) && console.log("work1");
(time === 3500) && console.log("work2");
(time === 4300) && console.log("work3");
}, 100)
+ 2
Coder-Rohit[{(∞)}] can you do it with Es6 promise.