I’m supposed to make sure else if statements are in the right order, and they seemed to be so I ran the test and only one checkmark needs to be met, and I need help with that one, and what is orderMyLogic(7)?
Your code so far
function orderMyLogic(val) {
if (val < 10) {
return "Less than 10";
} else if (val < 5) {
return "Less than 5";
} else {
return "Greater than or equal to 10";
}
}
orderMyLogic(7);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36.
I changed the location of the second if statement to the else statement below it and it didn’t the fix the issue, also peculiar then I changed the if (val < 10) to if (val > 10), it become the opposite the two checkpoints become wrong and the one I’m trying to fix become correct.
I know thank you, I need it to return “Less then five”, if it actually is less then five, not just less then ten, and changing the level between five and ten fixed the issue.