Is there a way to store the data fetched from a csv file using d3.csv() in a global variable for future use? I'm facing an issue where the global variable dataset is showing as undefined even after assigning it inside the d3.csv() function.
var dataset;
d3.csv("/csv/census_tracts.csv", function(data){
dataset=data;
});
console.log(dataset);