123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- </head>
- <body>
- <script>
- async function async1() {
- console.log('async1 start')
- await async2()
- setTimeout(function () {
- console.log('setTimeout1')
- }, 0)
- }
- async function async2() {
- setTimeout(function () {
- console.log('setTimeout2')
- }, 0)
- }
- console.log('script start')
- setTimeout(function () {
- console.log('setTimeout3')
- }, 0)
- async1()
- new Promise(function (r, j) {
- console.log('Promise1')
- r()
- }).then(function () {
- console.log('Promise2')
- })
- console.log('script end')
-
- </script>
- </body>
- </html>
|