var num = 2 var object_1 = {a: "a1",b:"b1"} var object_2 = {a: "a2",b:"b2"} var object_3 = {a: "a3",b:"b3"} var obj = ['',object_1,object_2,object_3] alert(obj[num]['a']);