live2d-widget/src/utils.js
2022-10-20 20:38:40 +08:00

6 lines
150 B
JavaScript

function randomSelection(obj) {
return Array.isArray(obj) ? obj[Math.floor(Math.random() * obj.length)] : obj;
}
export default randomSelection;