Array.prototype.remove = function (v) { this.splice(this.indexOf(v) == -1 ? this.length : this.indexOf(v), 1); }

Array.prototype.arrayFirst = function (predicate, predicateOwner) {
    for (var i = 0, j = this.length; i < j; i++)
        if (predicate.call(predicateOwner, this[i]))
            return this[i];
    return null;
};

Object.defineProperty(Object.prototype, "getName", {
    value: function () {
        var funcNameRegex = /function (.{1,})\(/;
        var results = (funcNameRegex).exec((this).constructor.toString());
        return (results && results.length > 1) ? results[1] : "";
    },
    enumerable: false
});

Array.prototype.pushArray = function (arr) {
    this.push.apply(this, arr);
};

Object.defineProperty(Object.prototype, "getMouseEvent", {
    value: function () {
        for (var i = 0; i < Object.keys(this).length; i++) {
            var ob = Object.keys(this)[i];
            if (this[ob].getName() == 'MouseEvent')
                return this[ob];
        }
    },
    enumerable: false
});

Object.defineProperty(Object.prototype, "Clone", {
    value: function () {
        return jQuery.extend(true, {}, this);
    },
    enumerable: false
});

function Clone(obj) {
    return jQuery.extend(true, {}, obj);
};