15.1 Introduction to Arrays (10 mins)
let student1 = "Alice"; let student2 = "Bob"; let student3 = "Charlie";let students = ["Alice", "Bob", "Charlie"];
let arrayName = [item1, item2, item3];let colors = ["Red", "Green", "Blue"];let numbers = [10, 20, 30, 40, 50];let mixedArray = ["Alice", 25, true];
let fruits = ["Apple", "Banana", "Cherry"]; console.log(fruits[0]); // Outputs: Apple console.log(fruits[1]); // Outputs: Banana
let numbers = [10, 20, 30]; numbers[1] = 25; // Changes the second element to 25 console.log(numbers); // Outputs: [10, 25, 30]
let colors = ["Red", "Green", "Blue"]; console.log(colors.length); // Outputs: 3
Student Activity (10 mins):
Step-by-Step Activity:
Activity Follow-up Questions:
Expected Outcome:
Last updated