blink/backend/tutorials/othertests.js

11 lines
344 B
JavaScript
Raw Normal View History

2023-10-10 22:01:52 +02:00
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');