eslam saidPro Student 6,733 Points
The callback function
I just wanna be sure that i get it, so as i understood that the callback function is where we put what we wanna do after we get a response from a server,
so the first step i must create XHR object to tell the browser that i wanna use ajax
then the callback function it
s like im saying to the server after getting a response do 1 and 2 and 3 am i right ?
Ivan Penchev13,832 Points
While technically you are right, i would look at this official description for reference:
A function that takes other functions as arguments or returns functions as its result is called a higher-order function, and the function that is passed as an argument is called a callback function. It's named “callback” because at some point in time it is “called back” by the higher-order function.
This may sound a bit fleshy, but its important to understand where exactly is a callback placed in the hierarchy.