I have made two functions to parse the CSV data with Papaparse, and one function to get the value from that data. The two functions use a return statement.
The problem I have is that the data I receive in Papaparse is always undefined. The value I would like to get is a mean value of the data in the CSV file. Here is a code snippet of where I would like the mean to be received:
function parseData() {
var csvfile = "probeersel11.csv";
$.get(csvfile, function (data) {
var csvdata = Papa.parse(data, {
header: true,
skipEmptyLines: true,
dynamicTyping: true
});
alert(doStuff(csvdata));
});
}
The question is: how do I receive the right value here?