diff --git a/src/global.ts b/src/global.ts index 26105d1..20bc6b0 100644 --- a/src/global.ts +++ b/src/global.ts @@ -233,7 +233,7 @@ export function ctor() { } Array.prototype.random = function (this: Array) { - return this[PublicShared.randomNum(0, this.length)]; + return this[PublicShared.randomNum(0, this.length - 1)]; }; Array.prototype.intersection = function (this: Array, other: Array) {