title: TypeError: Unable to get property '0' of undefined or null reference
body: <p>I am new to coding, I am trying to build an app that adds items to an order. I want the quantity to increase when an item is selected twice rather than list the item twice.</p>
  
  <p>Using index of, I get this error:</p>
  
  <blockquote>
    <p>TypeError: Unable to get property '0' of undefined or null reference</p>
  </blockquote>
  
  <p>Trying other things I get an error saying <code>indexOf</code> is not a function.</p>