修复ArrayUtils.randomItem获取undefined
This commit is contained in:
@@ -275,7 +275,7 @@ class ArrayUtils {
|
||||
* @param list
|
||||
*/
|
||||
public static randomItem<T>(list: T[]) {
|
||||
return list[RandomUtils.randint(0, list.length)];
|
||||
return list[RandomUtils.randint(0, list.length - 1)];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user