var obj = { one:1, two:2, three:3, four:4, five:5 }; var arr = [ "one", "two", "three", "four", "five" ]; //取得陣列的值 alert(arr[0]); //使用For迴圈取得陣列的值 for( i in arr){ alert(arr[i]); } //使用For迴圈取得陣列的值 for( i in obj){ alert(("#" + i) + " :: " + obj[i]); } //使用each迴圈取得陣列的值 $.each(obj, function(i, val) { alert(("#" + i) + " : " + obj[i]); });