js空对象值检察判断

if(Object.getOwnPropertyNames(data).length===0){
  console.log("该对象为空")  
}
原文地址:https://www.cnblogs.com/xiaokar/p/12582524.html