js-if判断非空等情况
const emptyValue =''; const undefinedValue = undefined; const nullValue = null; const emtpyArrayValue = []; const emptyObjectValue = {}; const secondLevelObjectValue ={name:'name'}; if(emptyValue || undefinedValue || nullValue || emtpyArrayValue.length>0 || Object.keys(emptyObjectValue).length>0 || secondLevelObjectValue.title ){ console.log(‘空’); }else{ console.log(‘非空’); }