✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
let profile = {
userLogin : 'admin',
role : 'administrator',
firstName: 'Mat',
secondName: ''
}
function setSecondName (userInfo, secondName = 'Unknown') {
if (typeof userInfo !== 'object') {
return false;
} else {
userInfo.secondName = secondName;
}
}
setSecondName(profile, 'Damon');