title: How can I convert string to array of objects in JavaScript
body: <p>This is the string <code>Option 1|false|Option 2|false|Option 3|false|Option 4|true</code> I want to convert it to array of objects like this</p>
  <p>Is This Possible In javaScript Nodejs????
  thanks in Advance.</p>
  <pre><code>[
    {
      &quot;option&quot;: &quot;Option 1&quot;,
      &quot;value&quot;: false
    },
    {
      &quot;option&quot;: &quot;Option 2&quot;,
      &quot;value&quot;: false
    },
    {
      &quot;option&quot;: &quot;Option 3&quot;,
      &quot;value&quot;: false
    },
    {
      &quot;option&quot;: &quot;Option 4&quot;,
      &quot;value&quot;: true
    }
  ]
  </code></pre>