1.空对象的判断
let obj={}; Object.keys(obj).length ==0 //为空
2.对象为null的判断
let obj=null;if (!obj&& typeof (obj) != "undefined" && obj!= 0) { console.log('obj为null') }