Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript async delay

const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

(async () => {
  console.log('1');
  await delay(1000);
  console.log('2');
})();
 
PREVIOUS NEXT
Tagged: #javascript #async #delay
ADD COMMENT
Topic
Name
2+6 =