Splice challenge

Tell us what’s happening:

Your code so far


function htmlColorNames(arr) {
// Only change code below this line

// Only change code above this line
return arr;
}

console.log(htmlColorNames(['DarkGoldenRod', 'WhiteSmoke', 'LavenderBlush', 'PaleTurquoise', 'FireBrick']));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0.

Challenge: Add Items Using splice()

Link to the challenge:

please tell us what’s happenig
what are you having issues with?
there is something you do not understand?

Why does TypeError: arr[i] is undefined appear? - here there is an error and in this splice challenge which has the same syntax there isn’t; i’m wondering why; thank you for your interest