export {} if (!Array.prototype.at) { Array.prototype.at = function (index: number) { // Convert the index to an integer index = Math.trunc(index) || 0 if (index < 0) { index += this.length } if (index < 0 || index >= this.length) { return undefined } return this[index] } } if (!String.prototype.at) { String.prototype.at = function (index: number) { index = Math.trunc(index) || 0 if (index < 0) { index += this.length } if (index < 0 || index >= this.length) { return undefined } return this.charAt(index) } }