i am new to JavaScript and i have no idea why the function is not seeing the integer as a number, its suing it as a string and when i load it, it says undefined; help.
[code]const calcAverage = () => {
//ITS A NUMBER HERE
const DolphinScore = (44 + 23 + 71) / 3
const KoalaScore = (65 + 54 + 49) / 3
return
}
calcAverage()
function checkWinner(DolphinScore, KoalaScore) {
const koalaAvg = KoalaScore
const dolphinAvg = DolphinScore
if (dolphinAvg => koalaAvg * 2) { //ITS NOT A NUMBER
console.log(`dolphins win (${dolphinAvg} to ${koalaAvg})`)
} //WHY IS IT A STRING
else if (koalaAvg => dolphinAvg * 2) {
console.log(`koalas win (${dolphinAvg} to ${koalaAvg})`)
}
else {
console.log(`no one wins (${dolphinAvg} to ${koalaAvg})`)
}
return
}
checkWinner()