var arr = [[3,-4,6],[-11,71,0],[-4,-7,19]], t = 1 , e = 2 , l = arr.length; while (l--) { arr[l].splice(e,1); if(l==t) arr.splice(t,1) } alert(arr.join('\n'));