38 lines
874 B
JavaScript
38 lines
874 B
JavaScript
(function() {
|
|
|
|
// let's add some "evil" prototype definitions
|
|
|
|
if(!String.prototype.contains) {
|
|
String.prototype.contains = function(startIndex) {
|
|
return this.indexOf(startIndex) !== -1;
|
|
};
|
|
}
|
|
|
|
if(!Array.prototype.contains) {
|
|
Array.prototype.contains = function(startIndex) {
|
|
return this.indexOf(startIndex) !== -1;
|
|
};
|
|
}
|
|
|
|
if(!Array.prototype.last) {
|
|
Array.prototype.last = function() {
|
|
return this[this.length - 1];
|
|
};
|
|
}
|
|
|
|
if(!Array.prototype.first) {
|
|
Array.prototype.first = function() {
|
|
return this[0];
|
|
};
|
|
}
|
|
|
|
if(!Node.prototype.wipeChildren) {
|
|
Node.prototype.wipeChildren = function() {
|
|
while(this.lastChild) {
|
|
this.removeChild(this.lastChild);
|
|
}
|
|
};
|
|
}
|
|
|
|
})();
|