Copy array items using Slice

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**
function forecast(arr) {
// Only change code below this line
arr.slice(2, 4);
return arr;
}

// Only change code above this line
console.log(forecast(['cold', 'rainy', 'warm', 'sunny', 'cool', 'thunderstorms']));
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36

Challenge: Copy Array Items Using slice()

Link to the challenge:

You are making a copy of the array, not doing anything with it, then returning the original array.

1 Like