[第二週] Array 陣列


Aug 05, 2020

可以儲存多個值於一個變數中。
每一個陣列中的元素,都附有一個能讀相對應元素的數字,稱做數字索引(numeric index)。
在 JavaScript 中,陣列的索引開始於數字 0

var score = [1, 3, 5, 10, 100]
score.push(80)
score.push(60)
console.log(score, score,length)
// 輸出 [1, 3, 5, 10, 100, 80, 60] 7

console.log(score[1])
// 輸出 3
#Array






你可能感興趣的文章

CH2. 在執行時期產生網頁

CH2. 在執行時期產生網頁

JS 與瀏覽器的溝通與網頁事件處理

JS 與瀏覽器的溝通與網頁事件處理

連接RabbitMQ的AMQP時碰到The protocol requested by peer '0 0 9 1' does not match expected '3 1 0 0之原因與解法

連接RabbitMQ的AMQP時碰到The protocol requested by peer '0 0 9 1' does not match expected '3 1 0 0之原因與解法






留言討論






2
2
2