'use strict'; Array.prototype.first = function() { return this[0]; }; Array.prototype.last = function() { return this[this.length - 1]; }; Array.prototype.removeAtIndex = function(index) { if (isNaN(index) || index > this.length) { return false; } this.splice(index, 1); return true; }; Array.prototype.removeObj = function(value) { let index = this.indexOf(value); if (!index) return false; this.splice(index, 1); return true; };