Grokking Node.js
0% completed
Understanding Callbacks, Promises, and Async/Await
A function that you hand to another function, so that it can be called later when a slow job has finished, is called a callback. Reading a file, sending a network request and querying a database are all slow jobs of this kind. Node.js starts the job, keeps running the rest of your program, and calls your callback once the result is ready.
This chapter is about writing code that waits for slow jobs without stopping the program. It starts with the three styles Node.js code uses for this: callbacks, promises, and async/await
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%