🎯 Learning Objectives
By the end of this class, students will be able to:
- Understand what arrays are and why we use them
- Create and use arrays
- Access and update array elements
- Loop through arrays using different methods
- Use important array methods (push, pop, shift, unshift, indexOf, includes, slice, splice)
- Work with arrays in real-life programs
#️⃣ 1. What Are Arrays?
An array is a special variable that can store multiple values in a single place.
💬 Real-Life Examples of Arrays:
- A shopping list
- A class attendance list
- A playlist
- A list of numbers (marks, prices, scores)
📘 Without array:
let student1 = "Ali";
let student2 = "Sara";
let student3 = "Hamza";
📘 With array:
let students = ["Ali", "Sara", "Hamza"];
✔ Cleaner