When I first started learning to code, I found the concept of callbacks extremely confusing. Which is funny, because I was using them all the time without realising it - If you currently use jQuery
, then you are already using callbacks. (More on this later).
So here's my attempt to try and explain callbacks in as simple a way as I can. I'll probably gloss over some details here, but keep in mind this is a beginner's guide. If you see any glaring errors, feel free to ask me to change it.
So here goes:
##Basic definition: ####A callback is a function that is passed as an argument to another function.