A callback is a function passed as an argument to another function
This technique allows a function to call another function
A callback function can run after another function has finished
This technique allows a function to call another function
A callback function can run after another function has finished
When to Use a Callback?
Where callbacks really shine is in asynchronous functions, where one function has to wait for another function (like waiting for a file to load).
Where callbacks really shine is in asynchronous functions, where one function has to wait for another function (like waiting for a file to load).
Loading suggestions...