Array.prototype.remove = function (val) {
var index = this.indexOf(val);
if (index > -1) {
this.splice(index, 1);
}
}
var arr = ['apple', 'banana', 'orange', 'pear']
arr.remove('banana')
console.log(arr) // ['apple', 'orange', 'pear']