Saturday 27 April 2019

async/await help

For context, This is a method in a class. I need it to display "first, second, third". I think my understanding of async/await is wrong because this shows "third, second, first". Can anyone help me out?async testing() {await setTimeout(() => {console.log('first')}, 1500);if(true) {await setTimeout(() => {console.log('second')}, 1000);}await setTimeout(() => {console.log('third')}, 500);

Submitted April 28, 2019 at 04:57AM by Stripestar

No comments:

Post a Comment