wierd problem with $.each

wierd problem with $.each

data.items is an array from an ajax request which returns a json.

alert(data.items.length) before of this snippet returns 12, which is correct.

  1. alert(data.items.length)
  2. $.each(data.items,function(index, item){
  3.                                //alert(item)
  4.                                 if (!$.isArray(item)) {
  5.                                    
  6.                                     arr = hashtoArray(item);
  7.                                   
  8.                                 } else {
  9.                                    
  10.                                     arr = item;
  11.                                 
  12.                                 }
  13.                                 first = arr.shift();
  14.                            
  15.                                 if (first.indexOf('Cat') > -1) {
  16.                                   $("#desf").append(first + " ");
  17.                                   $('#desf').append(arr.join(',') + '<br/>\n');
  18.                                 } else {
  19.                                    $('#desf').append(first + "," + arr.join(',') + '<br/>\n');
  20.                                 }
  21.                                
  22.                                
  23.                             });                               
  24.                      
  25. However in the #desf  id i only get 8 array's displayed. However as i said in the beggining there should be 12!!! Where are the other 4??? In another page this snippet works ok!! In the same browser.
  26. Thanks for the help!