1const async1 = async () => {
2 console.log('async1');
3 setTimeout(() => {
4 console.log('timer1')
5 }, 2000)
6 await new Promise(resolve => {
7 console.log('promise1')
8 })
9 console.log('async1 end')
10 return 'async1 success'
11}
12console.log('script start');
13async1().then(res => console.log(res));
14console.log('script end');
15Promise.resolve(1)
16 .then(2)
17 .then(Promise.resolve(3))
18 .catch(4)
19 .then(res => console.log(res))
20setTimeout(() => {
21 console.log('timer2')
22}, 1000)
23