Convert a Javascript object to a CSV file
Join the DZone community and get the full member experience.
Join For FreeThe following will, print out a Javascript object as a string – edit as you see fit.
function csv(placesQueue) { var str = 'latitude,longitude\n'; // column headers $.each(placesQueue, function(idx, x) { str = str + x.geometry.location.jb + "," + x.geometry.location.kb + "\n" }); return str; }
Published at DZone with permission of Gary Sieling, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments