Demo
View Source
Click here to convert fruits array to CSV:
Convert to CSV
var fruits = ['apple', 'peaches', 'oranges', 'mangoes'];