Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Async return values

// wait ms milliseconds
function wait(ms) {
  return new Promise(r => setTimeout(r, ms));
}

async function hello() {
  await wait(500);
  return 'world';
}
Source by web.dev #
 
PREVIOUS NEXT
Tagged: #Async #return #values
ADD COMMENT
Topic
Name
3+8 =