In below code res is a 2 dimensional array contatining .csv data returned by server.
var result;
Meteor.call('parseFile', (err, res) => {
if (err) {
alert(err);
} else {
// success!
alert(res[0][0]);
result = res
}
});
let longitude = result[0];
I am using above code. And the value stored in result variable is null.However, in alert the variable res has values stored in it. I searched online and they say this is due to some fibre thing and advised to use session variable. But, I am not able to get that correct also. So, my question is basically how to use the array returned by server stored in res variable to use outside the function scope.