Periksa JavaScript Objek yang Tidak Ditentukan Satu liner diatur ke EMTPY
const isEmpty = Object.values(object).every(x => (x === null || x === ''));
Cheerful Crab
const isEmpty = Object.values(object).every(x => (x === null || x === ''));
console.log(myVar == null ? myVar.myProp : 'fallBackValue');