Created
March 14, 2020 11:43
-
-
Save attilaking/570856920dfe7f9fce77861355bc177c to your computer and use it in GitHub Desktop.
[Callback] Callback#callback
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add() function is called with arguments a, b | |
// and callback, callback will be executed just | |
// after ending of add() function | |
function add(a, b , callback){ | |
document.write(`The sum of ${a} and ${b} is ${a+b}.` +"<br>"); | |
callback(); | |
} | |
// disp() function is called just | |
// after the ending of add() function | |
function disp(){ | |
document.write('This must be printed after addition'); | |
} | |
// Calling add() function | |
add(5,6,disp); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment