创建一个整数数组并访问其中的第四个元素



我刚开始学习javascript,明天我有一项任务要创建一个简单的整数数组并访问它的第四个元素请考虑我的任务

// create an array
const array = [111, 222, 333, 444, 555, 666, 777, 888, 999]
// access the fourth element with the index 3. Indexing starts from 0
const fourthElement = array[3]
// output - '444'
console.log(fourthElement)

最新更新