UNPKG

595 BJavaScriptView Raw
1"use strict";
2String.prototype.capitalize = function () {
3 return this.charAt(0).toUpperCase() + this.slice(1);
4};
5Array.prototype.insert = function (index, items) {
6 for (let i = index; i < index + items.length; i++) {
7 this[i] = items[i - index];
8 }
9 return this;
10};
11Array.prototype.remove = function (o) {
12 const index = this.indexOf(o);
13 if (index === -1)
14 return this;
15 this.splice(index, 1);
16 return this;
17};
18Array.prototype.random = function () {
19 return this[Math.floor(Math.random() * this.length)];
20};
21//# sourceMappingURL=node-additions.js.map
\No newline at end of file