Mayank MunjalFront End Web Development Techdegree Graduate 18,120 Points
So xhr.onreadystangechange is the callback function but I'm getting confused as to when it is called back?
I don't see a higher order function using the callback function as an argument so if someone can explain what's going on, it will help a lot!
Steven Parker170,448 Points
The callback function is used by an internal event handler that is established by the "
xhr.send()" call. It accesses the callback directly as a property of the "xhr" object instead of having it passed as an argument.