1function resolveAfter2Seconds(x) {
2 return new Promise(resolve => {
3 setTimeout(() => {
4 resolve(x);
5 }, 2000);
6 });
7}
8
9async function f1() {
10 var x = await resolveAfter2Seconds(10);
11 console.log(x); // 10
12}
13
14f1();
15