Question: how node js callback works?
Answer: Node. js, being an asynchronous platform, doesn't wait around for things like file I/O to finish - Node. js uses callbacks. A callback is a function called at the completion of a given task; this prevents any blocking, and allows other code to be run in the meantime.