當資料數量變多時,逐一建立變數會很麻煩。陣列可一次存放多個同類資料。
var arr = new Array("HTML", "CSS", "JavaScript", "jQuery");
若要取得其中一項,可使用索引,例如 arr[2] 代表 JavaScript。