Array.prototype.peek = function () {
    return this[this.length - 1];
}
Array.prototype.contains = function ( needle ) {
    for (i in this) {
        if (this[i] == needle) return true;
    }
    return false;
}

