CHALLENGE
const user = {
details: {
name: 'Alex',
contact: null,
preferences: {
theme: 'dark'
}
},
getInfo() {
return this?.details?.contact?.email ||
this?.details?.preferences?.theme ||
this?.details?.name ||
'Unknown';
}
};
console.log(user.getInfo());
>>Click here to continue<<