userimage

What is Callback in node.js?

What is Callback in node.js?
userimage
In node.js callback is an asynchronous equivalent for a function which is called at the completion of a given task. Basically node.js makes heavy use of callbacks as well as all the APIs of node.js are written is such a way that they supports callbacks. For example, a function to read a file may start reading file and return the control to execution environment immidiately so that next instruction can be executed. Once file I/O is complete, it will call the callback function while passing the callback function, the content of the file as parameter. So there is no blocking or wait for File I/O. This makes node.js highly scalable, as it can process high number of request without waiting for any function to return result.
Answer is