val numbers = arrayOf(1, 2, 3, 4, 5) // 修改索引为 2 的元素 numbers.set(2, 10) // 修改后的数组: [1, 2, 10, 4, 5] numbers.forEach { _console.log(it) }