'F' → Fullscreen
// Arrays store a collection of related values under one variable name.let scores = [84, 91, 76, 88, 95];
// Elements are accessed by index (position).// Indexes start at 0.console.log(scores[0]); // first elementconsole.log(scores[2]); // third element// Updating an elementlet scores = [84, 91, 76, 88, 95];
// Change the second score (index 1) to 100scores[1] = 100;
console.log(scores);// Task 1 — Create and Access Arrays// Follow the steps below.
// 1) Create an array named 'foods' with 5 food strings.let foods = ["pizza", "tacos", "sushi", "pasta", "burgers"];
// 2) Print the FIRST food (index 0).console.log("First food:", foods[0]);
// 3) Print the THIRD food (index 2).console.log("Third food:", foods[2]);
// 4) Print the LAST food.// (Hint: for today, you may use the last index directly since you know there are 5 items.)console.log("Last food:", foods[4]);
// 5) Answer (in a comment):// If foods has 5 elements, what is the last index? Why?// Task 2 — Modify an Array + Mini Challenge
let temps = [72, 68, 75, 70, 69];
// 1) Print the temperature at index 3 with a label.console.log("Temp at index 3:", temps[3]);
// 2) Update the FIRST temperature to 74.temps[0] = 74;
// 3) Update the LAST temperature to 71.temps[4] = 71;
// 4) Print the entire temps array so we can see the changes.console.log("Updated temps:", temps);
// 5) Mini Challenge (no loops):// Create a variable named 'range' that equals highest - lowest.// Use ONLY index access (temps[?]) and Math.max/Math.min.// Then print: "Range: X"//// Hint: Math.max(temps[0], temps[1], temps[2], temps[3], temps[4])// Hint: Math.min(temps[0], temps[1], temps[2], temps[3], temps[4])Your program output should something similar to the sample output below.
First food: pizzaThird food: sushiLast food: burgersTemp at index 3: 70Updated temps: [74, 68, 75, 70, 71]Range: 7You may write your reflection answers as comments at the bottom of your code.
Submit your activity and reflection answers to the appropriate dropbox.