Tell us what’s happening:
Output is correct, and the function is using the splice command, but the answer isn’t registering as correct.
What am I doing wrong?
Your code so far
function forecast(arr) {
// Only change code below this line
return arr.splice(2,2);
}
// 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/80.0.3987.149 Safari/537.36
.
Challenge: Copy Array Items Using slice()
Link to the challenge: