I have a very simple array that I'd like to export to CSV:
var uniqueCounties = ["555","123","345"];
I have tried using methods found online but I have been getting various errors, and all the methods online deal with nested arrays.
My function at the moment is converting to a string. I was hoping it would simplify the process but I'm still now sure how to progress:
function download_csv() {
var csv = uniqueCounties.toString();
console.log(csv);
}
I was originally trying this method:
uniqueCounties.forEach(function(infoArray, index){
dataString = infoArray.join(",");
csvContent += index < data.length ? dataString+ "\n" : dataString;
});
But kept getting the error infoArray.join is not a function
.