﻿Array.prototype.remove = function(from, to) {
    var rest = this.slice((to || from) + 1 || this.length);
    this.length = from < 0 ? this.length + from : from;
    return this.push.apply(this, rest);
};

Array.prototype.removeByElement = function (arrayElement) {
    for (var i = 0; i < this.length; i++)
    {
        if (this[i] == arrayElement)
            this.splice(i, 1);
    }
}

Array.prototype.contains = function(obj) {
    var i = this.length;
    
    while (i--)
    {
        if (typeof this[i] != "undefined" && typeof obj != "undefined" && this[i].toString() === obj.toString())
        {
            return true;
        }
    }
    return false;
}

