A callback is a function passed to another operation so it can be invoked later, usually after asynchronous data arrives or an event occurs. This avoids blocking the user interface, but reverses ordinary control flow: “Don’t call me, I’ll call you.” section 8.1
Fetching students asynchronously
A request returns before its data is ready, so passing showStudents as the success callback makes it run at the correct time: getJSON('/students', students => showStudents(students), error => console.log(error.message)). section 8.1
Callbacks also receive errors through a separate error callback. They work well for one asynchronous step, but sequential requests can produce deeply nested success and error handlers—the callback pyramid—which is difficult to read and scale. section 8.1


















