(arr: any[], index?: number)
| 26 | |
| 27 | // 获取数组中随机元素 |
| 28 | export function getRandomItem(arr: any[], index?: number) { |
| 29 | index || (index = Math.round(Math.random() * (arr.length - 1))); |
| 30 | return arr[index]; |
| 31 | } |
| 32 | |
| 33 | export function getStorage(key: string, defaultValue: any) { |
| 34 | if (typeof window !== 'undefined') { |
nothing calls this directly
no outgoing calls
no test coverage detected