Predict 数组 Access
预测输出 入门
题目
什么做 这个 code print?
代码
const fruits = ["apple", "banana", "cherry"];
console.log(fruits[1]);
提示
数组是 零-indexed: 索引 0 是首先元素.
解释
fruits[0] is "apple", fruits[1] is "banana", fruits[2] is "cherry". Since arrays are zero-indexed, index 1 refers to the second element. The output is: banana
相关资源
相关课程
- 数组
学习如何 access 数组元素通过索引.
查阅不认识的术语
新手友好的术语表用大白话解释编程术语——变量、函数、DOM、Promise 等等。
解读错误信息
用大白话解释常见错误——什么意思、为什么发生、如何修复。
动手做项目
通过引导式项目应用所学,含起始代码与解决方案。