title: local storage not identifying array name
body: <p>I am trying to save an array of "items" in the cart. but when it goes on else section an error occur "Uncaught TypeError: Cannot read property 'items' of null" please help what's wrong with the code</p>
  
  <pre><code>var existing_cart = localStorage.getItem("cart");
  existing_cart = JSON.parse(existing_cart);
  console.log(existing_cart);
  
  if (existing_cart.items instanceof Array) {
  
    existing_cart.items.push({
      'article_number': article_no,
      'quantity': quantity,
      'item_name ': item_name
    });
    console.log(existing_cart);
    localStorage.setItem("cart", JSON.stringify(existing_cart));
  
  } else {
  
    var products = [{
      'article_number': article_no,
      'quantity': quantity,
      'item_name ': item_name
    }];
    var cart = {
      'items': products
    }
    localStorage.setItem("cart", JSON.stringify(cart));
    toastr.success('Have fun storming the castle!', 'Miracle Max Says');
  }
  </code></pre>