title: How to get array after convert by reduce()
body: <p>How to get an array after converted by reduce()? <br/></p>
  <p>Before convert:
  <a href="https://i.stack.imgur.com/0iqkV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0iqkV.png" alt="enter image description here" /></a></p>
  <p>After convert:</p>
  <pre><code>newProductsDetail = newProductsDetail.reduce((acc, curr) =&gt; {
        const { categoryName } = curr
        if (!acc[categoryName]) {
          acc[categoryName] = []
        }
        acc[categoryName].push(curr)
        return acc
      }, [])
  </code></pre>
  <p><a href="https://i.stack.imgur.com/3jWso.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3jWso.png" alt="enter image description here" /></a></p>
  <p>I would like get <code>newProductsDetail[categoryName]</code></p>
  <p>Have any way to approach this?</p>
  <p>Thanks to all of you!</p>