Tell us what’s happening:
understanding the second argument of slice is quite difficult to understand. is the second index counting from the beginning of the array?
Your code so far
function forecast(arr) {
// Only change code below this line
arr.slice(2,1)
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/115.0.0.0 Safari/537.36 Edg/115.0.1901.188
Challenge: Basic Data Structures - Copy Array Items Using slice()
Link to the challenge: