title: Why am I receiving 'NaN' from my reducer function?
body: <p>I am adding up the quantity in my cart. I pull the state off my redux state using hooks useSelector for all the items in my cart and use reduce to add up all the quantities and display them in my cart icon.</p>
  <pre><code>const cartItems = useSelector( (state) =&gt; state.cart.cartItems)
  const itemCount = cartItems.reduce((accumulatedQuantity, cartItem) =&gt; 
    accumulatedQuantity + cartItem.quantity, 0
  
  )
  
  console.log(itemCount)
  </code></pre>
  <p>Item count here is 'NaN'</p>
  <p><a href="https://i.stack.imgur.com/NxNlr.png" rel="nofollow noreferrer">My redux cart state</a></p>