JSFiddle - React, Tailwind, and code Playground

JavaScript

var Window = function(tabs) {
  this.tabs = tabs; // We keep a record of the array inside the object
};

// When you close a tab
Window.prototype.tabClose = function (index) {

  // Only change code below this line

  var tabsBeforeIndex = this.tabs.slice(0, index);
  var tabsAfterIndex = this.tabs.slice(index + 1);
  this.tabs = tabsBeforeIndex.concat(tabsAfterIndex);

  // Only change code above this line

  return this;
};

var videoWindow = new Window(['Netflix', 'YouTube', 'Vimeo', 'Vine']); // Entertainment sites
console.log(videoWindow.tabClose(2).tabs);