Data Structures and AlgorithmsArrays

Arrays store multiple values in a single variable. They allow fast access to elements by index and are fundamental for building other data structures. Operations include insertion, deletion, traversal, and searching.

let numbers = [1, 2, 3, 4];
numbers.push(5); // Add element
numbers.splice(2, 1); // Remove element at index 2
console.log(numbers);