Showing
1 changed file
with
14 additions
and
0 deletions
Experiments/nodejs/Assignments/02/index.js
0 → 100644
1 | +const doSomethingAsync = () => { | ||
2 | + return new Promise(resolve => { | ||
3 | + setTimeout(() => resolve('I did something'), 3000) | ||
4 | + }) | ||
5 | +} | ||
6 | + | ||
7 | +// doSomething 함수를 async await 형태로 변경하시오 | ||
8 | +const doSomething = () => { | ||
9 | + doSomethingAsync().then( a => console.log(a)) | ||
10 | +} | ||
11 | + | ||
12 | +console.log('Before') | ||
13 | +doSomething() | ||
14 | +console.log('After') |
-
Please register or login to post a comment