I have two javascript functions.
This is one function and other one is also same.
function function1(.., .., callback){
//database logic
callback(data);
}
My requirement is to get data from both functions and send to client side.
function sendFunction(){
function1(.., .., function(data1)){
console.log(data1);
}
function2(.., .., function(data2)){
console.log(data2);
}
sendToClient(data1+data2);
}
My issue is how can I take outside data1 and data2 from functions to concatenate. Guide me to achieve this task.
data1anddata2from both the functions?console.log(data1, data2)?undefinedor anything else ?