Chapter VIII · Arrays
Array Methods
Array methods are built-in functions providing utility operations to mutate or inspect array items.
01 How It Works
Think of conveyor belts handling items at the ends of a queue line.
Methods modify array contents or return inspected data values.
example.js
const list = [1, 2];
list.push(3); // [1, 2, 3]
list.pop(); // [1, 2]
1. Target an array instance.
2. Call mutation or inspection methods (push, pop, shift, unshift).
3. Observe modified array state.
02 Practical Example
Here is how you might see this concept applied in real-world code:
practical.js
const queue = ["A", "B"];
queue.push("C");
queue.shift(); // Removes "A"
Key Takeaway
Array methods provide built-in tools for managing list items.