Can I use an if statement with a false condition?

//Dear all, this is my code. What happened when I run it was that, if every number is between 0 and 100, then things are perfectly fine; however, if one of the numbers exceeded the range, then the code would print: You have entered an invalid grade. WITH another line below saying: undefined

//I have no idea why is this happening… Please help.

const finalGrade = (item1, item2, item3) => {
if ((item1 < 0 || item1 > 100) || (item2 < 0 || item2 > 100) || (item3 < 0 || item3 > 100)) {console.log(‘You have entered an invalid grade.’);}

else {

const sum = item1 + item2 + item3;
const avg = sum / 3;
console.log(avg);

if (avg>=0 && avg<59){return ‘F’;
} else if (avg >= 60 && avg < 69){return ‘D’;} else if (avg >= 70 && avg < 79){return ‘C’;} else if (avg >= 80 && avg <89){return ‘B’;} else if (avg >=90 && avg<=100){return ‘A’;}

}
}

I just don’t understand why I cannot use the structure of:

if(condition dissatisfied) {log this}

else {calculate}

Try this and see what happens:

if (false) {
    console.log("it's true!")
} else {
    console.log("it's false!")
}

if will never allow flow through the first code block if the conditional expression is not truthy.