Function - Callback function

> Code - (Programming|Computer) Language > (Function | Operator | Map | Mapping | Transformation | Method | Rule | Task | Subroutine)

1 - About

A callback function is called back by the higher-order function that takes it as parameter.

Callbacks is a method of enabling asynchrony (asynchronous operation).

A callback is a function that is passed as an argument to another function and is executed after its parent function has completed.


3 - Example

Basic example in Javascript.

callback = function () {
   console.log("Hello Callback");
function highOrder(callbackFunctionToCall){
  // Call the callback function

4 - Hell

The callback hell is when there is so much callback that it build a multiple levels of nested callbacks rendering the code difficult to understand.