mirror of https://github.com/xfarrow/blink.git
11 lines
344 B
JavaScript
11 lines
344 B
JavaScript
async function exampleAsyncFunction() {
|
|
console.log('Before await');
|
|
await new Promise(function(resolve, reject) {
|
|
setTimeout(() => resolve("done"), 500);
|
|
}); // Pauses execution here until the promise resolves.
|
|
console.log('After await');
|
|
}
|
|
|
|
console.log('Start');
|
|
exampleAsyncFunction();
|
|
console.log('End'); |