Tell us what’s happening:
Describe your issue in detail here.
It keeps showing me orderMyLogic(4) should return the string Less than 5 pls where am I missing something
**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(4);
**Your browser information:**
User Agent is: Mozilla/5.0 (Linux; Android 9; TECNO CC6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.79 Mobile Safari/537.36
Change the order of logic in the function so that it will return the correct statements in all cases.
If val is less than 5 it is also less than 10.
You can think of this in terms of size in the physical world. Let us say you have two sieves one has 10mm holes and one has 5mm holes. If the item going through is small enough to go through the 5mm hole it is also small enough to go through the 10mm hole.
Tell us what’s happening:
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(4))
**Your browser information:**
User Agent is: Mozilla/5.0 (Linux; Android 9; TECNO CC6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.79 Mobile Safari/537.36
Do you understand the example code and what is being shown? Take some time and read the example code, it should give you a good idea of what it is you need to do with your own code.
function orderMyLogic(val) {
if (val < 5) {
return “Less than 5”;
} else if (val < 5) {
return “Less than 5”;
} else {
return “Greater than or equal to 10”;
}
}
orderMyLogic(4)
This will work, writing condition in particular also matters a lot.
It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.
We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.