Question: how to convert csv data to json format in javascript?
Answer: function csvJSON(csv){ var lines=csv. split("\n"); var result = []; var headers=lines[0]. split(","); for(var i=1;i<lines. length;i++){ var obj = {}; var currentline=lines[i]. split(","); for(var j=0;j<headers. length;j++){