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.

Advertising

3 - Example

Basic example in Javascript.

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

code/function/callback.txt · Last modified: 2019/02/16 17:40 by gerardnico