Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

"when.promise" async await


async function increment(num) {
  return num + 1;
}

// Even though you returned a number, the value is
// automatically wrapped in a promise, so we call
// `then` on it to access the returned value.
//
// Logs: 4
increment(3).then(num => console.log(num));

Source by coders911.org #
 
PREVIOUS NEXT
Tagged: #async #await
ADD COMMENT
Topic
Name
7+3 =