wanshenmean
2025-04-08 ef0a08b828d021bdc7978406e72bbde000097f5e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
 * 打乱传入的数组
 * 
 * @param {Array} array 待打乱的数组 
 */
function random(array = []) {
  return array.sort(() => Math.random() - 0.5)
}
 
/**
 * 判断是否为数组
 * 
 * @param {Object} arr
 */
function isArray(arr) {
  return Object.prototype.toString.call(arr) === '[object Array]'
}
 
export default {
  random,
  isArray
}