A schedule sometimes needs a short middle segment, then a few extra entries. Use slice() and concat() without changing the source array; inspect the result in the Console.
Unlike push() and pop(), slice(start, end) returns a new array without changing the original. It includes start but excludes end; concat() also returns a new array. Here you will use both.
const temperatures = [12, 14, 15, 17, 16, 13, 11];
const warmStretch = temperatures.slice(2, 5);
console.log(warmStretch);
combinedNumbers by concatenating [10, 11] to middleNumbers, producing [2,3,4,10,11] in the supplied probe.Use slice(1, 4) to get the middle three values from a five-item array.
Use concat() to join the sliced array with [10, 11].