javascript judges that the array is empty


 

    var  data = [];
    if(data&&data.length ==  0){
       //data为空数组时,要执行的代码
       alert("data为空");
    }

    
   


 

Guess you like

Origin blog.csdn.net/weixin_43837268/article/details/104491766