they said dont do this but I CANT READ
This commit is contained in:
parent
51d8c63637
commit
994214646a
1 changed files with 15 additions and 1 deletions
16
bot/util/prototypes.js
vendored
16
bot/util/prototypes.js
vendored
|
@ -1 +1,15 @@
|
|||
// extended prototype stuff
|
||||
// YEAH IM EXTENDING PROTOTYPES FUCK YOU
|
||||
|
||||
String.prototype.toProperCase = function () {
|
||||
return this.replace(/([^\W_]+[^\s-]*) */g, function (txt) {return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
|
||||
};
|
||||
|
||||
Array.prototype.random = function () {
|
||||
return this[Math.floor(Math.random() * this.length)];
|
||||
};
|
||||
|
||||
Array.prototype.remove = function (element) {
|
||||
const index = this.indexOf(element);
|
||||
if (index !== -1) this.splice(index, 1);
|
||||
return this;
|
||||
};
|
Loading…
Reference in a new issue