Callback Function
A callback function is a programming concept where a function is passed as an argument to another function. This allows the second function to execute the callback at a later time, often after completing a task. Callbacks are commonly used in asynchronous programming, enabling code to run without blocking the main thread.
For example, in JavaScript, a callback can be used to handle events or responses from a server. When a user clicks a button, the associated callback function can be triggered to perform an action, such as displaying a message or updating the user interface. This enhances the interactivity of applications.