// Only change code below this line
const tabsBeforeIndex = this.tabs.splice(0, index); // Get the tabs before the tab
const tabsAfterIndex = this.tabs.splice(index + 1); // Get the tabs after the tab
this.tabs = tabsBeforeIndex.concat(tabsAfterIndex); // Join them together
// Only change code above this line
You’re actually supposed to change this code see the comments // Only change code below this line // Only change code above this line
I have no idea. The author probably didn’t think about that solution.
Your solution is correct. In fact, it’s the one i used for that specific assignment as well. Didn’t seem to cause any problems for me.
I assume, the author’s intention was for students to use slice, instead of splice, as to not modify the original array, but that’s just my guess.