//判断数组是否为空
if (Array.isArray(array) && array.length) {
// array exists and is not empty
}
//判断数组是否为空
const isNotEmpty = arr => Array.isArray(arr) && arr.length > 0;
// console.log(isNotEmpty([1, 2, 3])); // Result: true
//console.log(isNotEmpty([])); // Result: false