mirror of
https://github.com/vastxie/99AI.git
synced 2025-09-17 17:26:38 +08:00
12 lines
372 B
JavaScript
12 lines
372 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.getRandomItemFromArray = void 0;
|
|
function getRandomItemFromArray(array) {
|
|
if (array.length === 0) {
|
|
return null;
|
|
}
|
|
const randomIndex = Math.floor(Math.random() * array.length);
|
|
return array[randomIndex];
|
|
}
|
|
exports.getRandomItemFromArray = getRandomItemFromArray;
|