arr.splice(0,2, 'DarkSalmon', 'BlanchedAlmond'); = works and does the job, but arr.splice(0,2, ['DarkSalmon', 'BlanchedAlmond']); = also works but it fails only the first test (htmlColorNames should return [“DarkSalmon”, “BlanchedAlmond”, “LavenderBlush”, “PaleTurqoise”, “FireBrick”])
and not the (You should not use array bracket notation.) if that is what it means by not using the bracket notation.
function htmlColorNames(arr) {
// change code below this line
arr.splice(0,2, 'DarkSalmon', 'BlanchedAlmond');
// change code above this line
return arr;
}
// do not change code below this line
console.log(htmlColorNames(['DarkGoldenRod', 'WhiteSmoke', 'LavenderBlush', 'PaleTurqoise', 'FireBrick']));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36.
While I’m here, is there a way to check how exactly is it added into the array - to see the difference in console when it’s lets say [["DarkSalmon", "BlanchedAlmond"], "LavanderBlush", "PaleTurqoise", "FireBrick"]
and not [“DarkSalmon”, “BlanchedAlmond”, “LavenderBlush”, “PaleTurqoise”, “FireBrick”]
Literally just turned on the browser console and saw it haha
Nice thanks for your help and time! hopefully I’ll be able to return the favour some day.
Cheers