title: how to modify json Object in javascript
body: <p>I am trying to load sample csv files into project read the content and display according to the filed. I done uploading and file writing but could not optimize the json structure properly for future use case </p>
  
  <blockquote>
    <p>Here is my sample code :</p>
  </blockquote>
  
  <pre><code>let csvToJson = require('convert-csv-to-json');
  let json = csvToJson.getJsonFromCsv(filepath);
  var lines = [];
  for(let i=0; i&lt;json.length;i++){
  console.log(json[i]);
  lines.push(json[i])
  }
  console.log(lines);
  var result3=JSON.stringify(lines);
  result3 = result3.replace(/\r?\n|\r/g, " ");
  console.log(result3);
  </code></pre>
  
  <blockquote>
    <p>My output:</p>
  </blockquote>
  
  <p><strong>console.log(json[i])</strong> =</p>
  
  <pre><code>Object {name,age,address: "asd,20,"12/76, 11th cross"
  "}
  browser.js:5358 Object {name,age,address: "dff,30,"33, 11th cross"
  "}
  browser.js:5358 Object {name,age,address: "f,22,"7g/22, 12th cross"
  "}
  browser.js:5358 Object {name,age,address: "ghth,55,"4h, 13th cross"
  "}
  </code></pre>
  
  <p><strong>console.log(lines)</strong> = [Object, Object, Object, Object, Object]</p>
  
  <p><strong>console.log(result3)</strong></p>
  
  <pre><code>[{"name,age,address":"asd,20,\"12/76, 11th cross\"\r"},
  {"name,age,address":"dff,30,\"33, 11th cross\"\r"},
  {"name,age,address":"f,22,\"7g/22, 12th cross\"\r"},
  {"name,age,address":"ghth,55,\"4h, 13th cross\"\r"},
  {"name,age,address":"fhg,44,\"6t, 10th cross\"\r"}]
  </code></pre>
  
  <p><strong>My expected output:</strong></p>
  
  <pre><code>{name:[],age:[],address:[]}
  </code></pre>
  
  <p>i.e I want all "name" values should store in the  name key similar to "age" and "address". Can anybody help me how to do this?</p>