var arr = [ {'title':'hello', id: 3533}, {'title' : 'data', 'id':5454}], keys = ['title', 'id'] for(var i=0;i<arr.length;i++) { var cell = arr[i]; for(var y = 0;y<keys.length;y++) { alert(cell[keys[y]]) } }