How can I pass a variable back to the callback function. Like for example if a api call finished, I want to return its data back to the function of the callback.
I want to archieve this (how do I pass the data variable?):
MyObject.DoItWithThis(function(***data***) {
console.log(data)
}
settings the callback --> API request starts --> API request finishes --> call the callback with the result.