Tell us what’s happening: It says that 4 should return less than 5, I have the last checks. I can’t seem to find my issue.
Describe your issue in detail here.
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";
}
}
console.log(orderMyLogic(7, 4, 6, 11));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0
Challenge Information:
Basic JavaScript - Logical Order in If Else Statements
Hi, read this line very carefully from the lesson and try to understand the example given “The function is executed from top to bottom so you will want to be careful of what statement comes first.”
You are doing the mistake of what lesson is warning you about.