[第二週] Array 陣列


可以儲存多個值於一個變數中。
每一個陣列中的元素,都附有一個能讀相對應元素的數字,稱做數字索引(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






你可能感興趣的文章

一起來看 Joshua B. Tenenbaum 教授有趣的認知科學研究 - Building Machines that Learn and Think Like People

一起來看 Joshua B. Tenenbaum 教授有趣的認知科學研究 - Building Machines that Learn and Think Like People

3. SpringBoot使用jms聆聽MQ

3. SpringBoot使用jms聆聽MQ

Deploy PERN stack with Netlify, Railway/Heroku/Render

Deploy PERN stack with Netlify, Railway/Heroku/Render






留言討論