About Lesson
Accessing and Modifying Array Elements
Array elements can be accessed using their index, starting from 0. You can also modify elements by directly assigning new values to specific indices.
Example:
JavaScript
let fruits = ["Apple", "Banana", "Mango"];
console.log(fruits[0]); // Output: Apple
// Modifying elements
fruits[1] = "Orange";
console.log(fruits); // Output: ["Apple", "Orange", "Mango"]