I've a typical use case (may be too specific to my use case).
I've a piece of like this:
var x=0,y=10;
var data = {"callback" : function(x,y) {console.log(x,y)}}
some where in the code flow im asynchronously call above anonymous function
call(data.callback);
my problem is in second piece of code i don't have data of x,y to pass on while calling function. So, is there any way we can attach data(x,y variables data) while declaration of function itself?
Edit 1:
@Kursad Gulseven, because, to make it simple i showed like that.
But, in actual case, "data", "callback" are dynamic names. So, i can't simple use data.callback.
Though i do that, i can't have variables (with data), where i'm trying to call my anonymous function . Because calling anonymous function is again from another asynchronous function which is what issue here.
Hope its clear and makes some sense.
data.callback(x,y);?