title: Destruct a string from split to named object
body: <p>I am investigating how create a named object in one go, using destruct</p>
  
  <p>A search for <a href="https://www.google.com/search?q=javascript+%2Bdestruct*+split+object+site%3Astackoverflow.com" rel="nofollow noreferrer">javascript destruct* split object</a> did not reveal how to directly destruct a string into an object using split.</p>
  
  <p>I do not mean reduce or map but pure destructing</p>
  
  <pre><code>const list = { ..... } = `......`.split(..)
  </code></pre>
  
  <p>or at least</p>
  
  <pre><code>const rowItem = { ..... } = `......`.split(..)
  </code></pre>
  
  <p>My initial version works, but there should be a neater way with less steps</p>
  
  <p>The initial split on lines is fine. It is the filling of the list using destruct I am curious about</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const rows = `100|Description 1|a|
  101|Description 2|a|
  102|Description 3|b|`.split("\n")
  
  let list = {}
  rows.forEach(row =&gt; {
    const [ProductId, Description, subCat, ] = row.split("|")
    list[ProductId] = {"Description": Description, "subCat": subCat }
  })
  
  console.log(list)</code></pre>
  </div>
  </div>
  </p>