[40분] Promises, Callbacks, async-await
- 일단 유튜브 강의는 다 들었다. 그런데 직접 해봐야 알 것 같아서 파일을 팠음.
# Promises, Callbacks
- 다음의 순서로 등장했다: Callbacks -> Promises -> async-await
- async-await은 Promise의 .then 같은 것을 쓰지 않음. More elegant way.
# Notes
- 다음의 둘은 동일한 뜻.
function() {} | () => {} |
# Callback function:
- Callback function is a function that is passed as an argument to another function.
- Using callback functions allows you to call a function from another function.
(Example)
https://youtu.be/nlKJmAvZoxo?si=bIrdfwHpxzhcMl4S
- HTML, JS 파일 만들어두려고 아래 영상을 참고함.
https://youtu.be/5a4gynygW9o?si=XPw-IFjTCxbPeqPT
# 다음에 할 일
- Callback function 따라해보기. 그대로도 따라하고, 몇 개 응용해서도 따라하자. (열어놓은 VS Code에 파일 하나 추가해서 따라하기.
- async-await 따라해보기. (하다 말았음)