callback function
nounUK /ˈkɔːlbæk ˈfʌŋkʃən/
US /ˈkɔːlbæk ˈfʌŋkʃən/
A callback function is a piece of code you give to another piece of code so it can run it later.
When the download finishes, the app runs the callback function to show a message.
RELATED WORDS
OTHER MEANINGS
2. In JavaScript, a function passed as an argument to another function and called when that function is done.
setTimeout(myCallback, 1000) runs myCallback after one second.
3. A routine registered with an event system to be invoked when a specific event occurs.
The button's click callback function updates the counter.
4. A function pointer used by an operating system or library to notify a program of an event.
The driver registers a callback function for incoming network packets.