Tell us what’s happening:
Am i crazy of is this else if statement missing the final { ?
In the example:
if (num > 15) {
return “Bigger than 15”;
} else if (num < 5) {
return “Smaller than 5”;
} else {
return “Between 5 and 15”;
}
Which there is clearly a { after the last else.
But the only way to pass the challenge is by omitting it…
What am I missing here?
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";
}
// Change this value to test
testElseIf(7);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/604.4.7 (KHTML, like Gecko) Version/11.0.2 Safari/604.4.7
.
Link to the challenge:
https://www.freecodecamp.org/challenges/introducing-else-if-statements