﻿if (!String.prototype.startsWith) {
    String.prototype.startsWith = function (str) {
        return !this.indexOf(str);
    }
}


// Append the elements of the array a to this array
if (!Array.prototype.append) {
    Array.prototype.append = function (a) {
        Array.prototype.push.apply(this, a);
    }
}

// filter an array
if (!Array.prototype.filter) {
    Array.prototype.filter = function (args) {
        var matches = [];
        var index, n = this.length;

        for (index = 0; index < n; index++) {
            if (this[index].toString().indexOf(args) != -1) { // found
                matches.push(this[index]);
            }
        }
        return (matches);
    }
}
