## Callbacks We can achieve asynchronous programming in JavaScript if we use the callbacks. A callback is a function that is passed as an argument to another function. The idea of the callback function is ‘I will call you back later’. You should know that the functions in JavaScript are executed in the sequence they are called, not in the sequence they are defined in. Okay, without confusing you, I will start from the beginning, why sequence control is so important in JavaScript. The sequence of control allows us to control the sequence when a function needs to be executed. For example, let us say that we want to create a function that will do some basic arithmetic operation like the sum of two integer numbers. After the function returns the result, we want to call another function to display the result to the user. So now we have two functions, one mainly for calculation, and the other is to display the user the result. Therefore we know their sequence of execution. Of course, you cannot start showing the results without first calling the calculation function. Here is the entire example including the HTML5 markup and the JavaScript Code (code in sequence.html file) : ```html <b>Sequence control in javascript</b> <span id="output">Output goes here</span> <form name="myForm" action="#"> <span class="firstOperand">First Operand</span> <input type="text" name="firstOperand" id="first"> <span class="secondOperand">Second Operand</span> <input type="text" name="secondOperand" id="second"> </form> ```  Javascript code ```js let calcbTN = document.querySelector("#calculate"); calcBtn.addEventListener("click", (e) => { e.preventDefault(); let a = parseInt(document.querySelector("#first").value); let b = parseInt(document.querySelector("#second").value); function printThis(theSum){ document.getElementById("output").innerHTML = theSum; } function calculateTwo(a, b){ let sum = a+ b; return sum; } let result = calculateTwo(a, b); printThis(result); }) ```