Example:
let weatherConditions = [‘rain’, ‘snow’, ‘sleet’, ‘hail’, ‘clear’];
let todaysWeather = weatherConditions.slice(1, 3);
// todaysWeather equals [‘snow’, ‘sleet’];
// weatherConditions still equals [‘rain’, ‘snow’, ‘sleet’, ‘hail’, ‘clear’]
My code:
function forecast(arr) {
// change code below this line
let array = arr.slice(2, 3);
return arr;
}
// do not change code below this line
console.log(forecast([‘cold’, ‘rainy’, ‘warm’, ‘sunny’, ‘cool’, ‘thunderstorms’]));
What do I just not understand well?
Thanks for your time and attention