📌  相关文章
📜  在 JavaScript 中检查数组是否为空、空或未定义? - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:28.592000             🧑  作者: Mango

代码示例2
let myArray = [];

if( myArray.length  > 0  ) {
    console.log(myArray);
    console.log("Array has elements");
}
else {
    console.log("Array has no elements");
}