I have 3 functions in javascript:
function A(){
B(data);
}
function B(data){
element.on('click',function(){
C(data);
});
}
function C(data){
//Process data
}
Function C does all data processing, but the data needs to be passed only on the click event, which I have defined in B. So, I need to pass data to B too, to ensure that C gets it. Here, A is my main program and I'd rather not define the click event there. Is there any other way to pass data directly to C from A?