function something()
{

  var x = window.localStorage.getItem('bbb'); // x = hh['bbb']

  x = x * 1 + 1; // x = x + 1

  window.localStorage.setItem('bbb', x); // hh['bbb'] = x

  alert(x);
}

function add_to_cart(id)
{
  var key = 'product_' + id;
  
  var x = window.localStorage.getItem(key);
  x = x * 1 + 1;
  window.localStorage.setItem(key, x);
}

@@ -246,11 +246,9 @@
 id;%0A
-  
 %0A
+
   va
@@ -304,16 +304,16 @@
  1 + 1;%0A
-
   window
@@ -339,14 +339,382 @@
 em(key, x);%0A
+  alert ('Items in your cart: ' + cart_get_number_of_items());%0A%7D%0A%0Afunction cart_get_number_of_items()%0A%7B%0A  var cnt = 0;%0A%0A  for(var i = 0; i %3C window.localStorage.length; i++)%0A  %7B%0A    var key = window.localStorage.key(i);%0A    var value = window.localStorage.getItem(key);%0A%0A    if (key.indexOf('product_') == 0)%0A    %7B%0A      cnt = cnt + value * 1;%0A    %7D%0A  %7D%0A  return cnt;%0A
 %7D%0A

Add cart_get_number_of_items function