Tell us what’s happening:
Hi,
on completion of running the test, the output is “less than 10”,
however it should be “10 or over” as it evaluates the second “if” statement ; as the input argument value for the function testGreaterOrEqual(10) is 10. screenshot attached. Pls explain.
Cheers,
SJ
Your code so far
function testGreaterOrEqual(val) {
if (val >= 20) { // Change this line
return "20 or Over";
}
if (val >= 10) { // Change this line
return "10 or Over";
}
return "Less than 10";
}
testGreaterOrEqual(10);
console.log(testGreaterOrEqual());
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0
.
Challenge: Comparison with the Greater Than Or Equal To Operator
Link to the challenge: