title: Javascript convert array value string to array
body: <p>How to convert this array string value to an array.</p>
  <pre><code> data = [&quot;genStatus: INPROGRESS,DONE&quot;, 
      &quot;status: ACTIVE,DEACTIVATE&quot;]
  </code></pre>
  <p>the expected output should be like this:</p>
  <pre><code>data = {
      genStatus: [&quot;INPROGRESS&quot;,&quot;DONE&quot;],
      status: [&quot;ACTIVE&quot;, &quot;DEACTIVATE&quot;]
  }
  </code></pre>
  <p>or should be like this</p>
  <pre><code>data = [{ name: 'genStatus', data: [{name: 'INPROGRESS'}, {name: 'DONE'}]},
  { name: 'status', data: [{name: 'ACTIVE'}, {name: 'DEACTIVATE'}]}]
  </code></pre>