You can have four different comparison functions - one sorting by item1, one by item2, one by item1 then item2 and one by item2 then item1.
E.g.:
arr.sort(function(a,b){
if(a.item1 == b.item1){
return a.item2 > b.item2 ? 1 : a.item2 < b.item2 ? -1 : 0;
}
return a.item1 > b.item1 ? 1 : -1;
});