what is callback in JavaScript

JavaScript is asynchronous. It’s means if you send HTTP request and on next line you execute something, it will not wait for the HTTP Response. For make this thing work, there is a strategy in JavaScript that is called Callback.

$.get(“demo_test.asp”, function(data, status){
// This code will execute after response received.

This is how Callback works in JavaScript.  For reference read these articles



One thought on “what is callback in JavaScript”

Leave a Reply

Your email address will not be published. Required fields are marked *