var i=0, result, txt=''; var arr = ... var keys = .. for(;i<arr.length;i++) { var cell = arr[i]; for(var y = 0;y<keys.length;y++) { alert(cell[keys[y]]) } }