A seating row needs a quick way to mark a contiguous group of unavailable seats. Use fill() on a copy and inspect the Console.
The fill() method is small but useful. It lets learners replace a range of values in one step and makes a good transition from simple indexing to array methods.
const weeklySlots = Array(5).fill("open");
weeklySlots.fill("closed", 3);
console.log(weeklySlots);
console.log().Use fill(value, start, end) to replace only part of the array.
Copy the original array before filling it if you want to preserve the source values.