crop_rotate
Run
<!DOCTYPE html> <html> <body> <h2>JavaScript async / await</h2> <p>Wait 3 seconds (3000 milliseconds) for this page to change.</p> <h1 id="demo"></h1> <script> async function myDisplay() { let myPromise = new Promise(function(resolve) { setTimeout(function() {resolve("I love You !!");}, 3000); }); document.getElementById("demo").innerHTML = await myPromise; } myDisplay(); </script> </body> </html>
PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxib2R5Pg0KDQo8aDI+SmF2YVNjcmlwdCBhc3luYyAvIGF3YWl0PC9oMj4NCg0KPHA+V2FpdCAzIHNlY29uZHMgKDMwMDAgbWlsbGlzZWNvbmRzKSBmb3IgdGhpcyBwYWdlIHRvIGNoYW5nZS48L3A+DQoNCjxoMSBpZD0iZGVtbyI+PC9oMT4NCg0KPHNjcmlwdD4NCmFzeW5jIGZ1bmN0aW9uIG15RGlzcGxheSgpIHsNCiAgbGV0IG15UHJvbWlzZSA9IG5ldyBQcm9taXNlKGZ1bmN0aW9uKHJlc29sdmUpIHsNCiAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge3Jlc29sdmUoIkkgbG92ZSBZb3UgISEiKTt9LCAzMDAwKTsNCiAgfSk7DQogIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJkZW1vIikuaW5uZXJIVE1MID0gYXdhaXQgbXlQcm9taXNlOw0KfQ0KDQpteURpc3BsYXkoKTsNCjwvc2NyaXB0Pg0KDQo8L2JvZHk+DQo8L2h0bWw+