Export an array of data to a CSV file via JavaScript.