var empty = null;
var arr = [[1, empty, 3, 4, 5, empty], [empty, 2, 3, 4, 5 ,234, empty], [empty, empty, empty, empty]];
for(var i = arr.length - 1; i > -1; i--) {
for(var j = arr[i].length - 1; j > -1; j--) {
if(!arr[i][j]) arr[i].splice(j,1);
}
if(arr[i].length == 0) arr.splice(i,1);
}
alert(JSON.stringify(arr));