должно выйти так:
getStatistic('Boris', '-') === 'Boris doesn't understand'
getStatistic('Boris', '0') === 'Boris doesn't understand'
getStatistic('Boris', '') === 'Boris doesn't understand'
getStatistic('Boris', '1') === 'Boris understands'
getStatistic('Boris', '+++') === 'Boris understands'
getStatistic('Boris', 'okay') === 'Boris understands'
getStatistic('Boris', NaN) === 'server error'
getStatistic('Boris', null) === 'server error'
Написал пока так. Если что не бейте, только учусь :)
getStatistic(`Boris`, '+')
function getStatistic(name, answer) {
const t = (Number(answer));
const g = (parseFloat(t));
const r = (Boolean(g));
if (r === false){
console.log(name + ` doesn't understand` )
}
else if (r === true){
console.log(name + ` understand`)
}
}