Vérifiez si la valeur de la clé d'objet est vide javascript
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');