I’m learning js and this simple challenge is spitting error code: " testElseIf(0)should return “Smaller than 5” but i’ve checked my code many times and it should be right?
Your code so far
function testElseIf(val) {
if (val > 10) {
return "Greater than 10";
} else if (val < 5) {
return "smaller than 5";
} else {
return "Between 5 and 10";
}
}
testElseIf(7);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36
.
Challenge: Introducing Else If Statements
Link to the challenge: