Copie o código do código da seguinte forma:
/**
* Método Startwith estendido
* @param str
* @Retornar
*/
String.prototype.startwith = function (str) {
If (str == null || str == "" || this.length == 0 || str.length> this.length)
Retornar falso;
If (this.substr (0, str.length) == str)
Retornar true;
outro
Retornar falso;
Retornar true;
};
/**
* Estender o método contém
* @param item
* @Retornar
*/
Array.prototype.contains = function (item) {
Retorne regexp ("// b"+item+"// b").
};
/**
* IE não suporta o método índiceof, adicionando o método do IE ao IE
*/
Array.prototype.indexOF = function (val) {
var valor = this;
for (var i = 0; i <value.length; i ++) {
if (valor [i] == val) retornar i;
}
Retornar -1;
};