Accessing Elements
Reading and writing array elements.
Examples
Read Element
Accessing the first element.
const cars = ["Saab", "Volvo", "BMW"];
let x = cars[0];
console.log(x); // SaabChange Element
Modifying an element.
const cars = ["Saab", "Volvo", "BMW"];
cars[0] = "Opel";
console.log(cars); // ["Opel", "Volvo", "BMW"]Test Your Knowledge
JavaScript Quiz
No quiz available for this topic yet.