async6 node javascript async waterfall # async waterfall ##### [source : https://jsfiddle.net/softm/rauy42ce/ ](https://jsfiddle.net/softm/rauy42ce/) ```javascript ``` 2019. 7. 12. node javascript async parallel # async parallel ##### [source : https://jsfiddle.net/softm/hj6qwevg/](https://jsfiddle.net/softm/hj6qwevg/) ```javascript ``` 2019. 7. 12. node javascript async series # async series ##### [source : https://jsfiddle.net/softm/3xkqnwcg/ ](https://jsfiddle.net/softm/3xkqnwcg/) ```javascript ``` 2019. 7. 12. Javascript Async, Await 심화 # Javascript Async, Await 심화 ```javascript // wait ms milliseconds function wait(ms) { return new Promise(r => setTimeout(r, ms)); } async function hello() { await wait(1500); return 'world'; } hello() .then(function(r,j){ console.info(r,j); }) .catch(function(e){ console.info(e); }); // ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== // wait ms milliseconds function wait(ms) { return new.. 2019. 7. 12. Javascript Async return Promise For await # Javascript Async return Promise For await ## # async function #### Reference - [https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Statements/async_function](https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Statements/async_function) #### async function - async function 선언은 AsyncFunction객체를 반환하는 하나의 비동기 함수를 정의한다. - 또한 async function expression을 사용해서 async function을 선언.. 2019. 7. 12. Javascript Async, Await 심화 Javascript Async, Await 심화 ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== // wait ms milliseconds function wait(ms) { return new Promise(r => setTimeout(r, ms)); } async function hello() { await wait(1500); return 'world'; } hello() .then(function(r,j){ console.info(r,j); }) .catch(function(e){ console.info(e); }); ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== // wait ms millise.. 2019. 1. 30. 이전 1 다음