I have a javascript which I didn’t write but I need to use it ..
function function1()
... body..
and at the end
I have this
'callback': 'getListCallback'
}
What does this callback mean and getListCallback = function(obj) is another function, does this mean that results from function1 are returned to function getListCallback?
Tnx
A callback function is a function that is going to be called later, usually when some event occurs. For example, when adding an event listener:
In many cases you pass the callback function as an anonymous function:
The code
getListCallback = function1(obj);will not call getListCallback with the results of function1(obj). It will store whateverfunction1(obj)returns intogetListCallback. If function1 returns a function, then you can call that function later, like so: