title: Session storage update items count
body: <p>I'm trying to create a simple counter using session storage, the objective is to show the item increase when you click on the respective add item.
  I'm having problems to check if the item is in the array and if it is not add it to array.</p>
  
  <p>my problem is in function itemsUpdate()</p>
  
  <p>Sorry i'm can't express the problem very well,
  try the demo and you will understand</p>
  
  <p>here is the demo: <a href="http://jsfiddle.net/t77hqka6/2/" rel="nofollow">http://jsfiddle.net/t77hqka6/2/</a> </p>
  
  <pre><code>`function itemsUpdate(items, item) {
     for (var i in items) {
       if (items[i].id === item.id) {
           console.log(items);
          items[i].value++;
           console.log(items);
           break;
       }
         else{
          items.push(item);
         }
     }
      if(items.length === 0)
           items.push(item);
  }`
  </code></pre>