Basic JavaScript: Comparison with the Greater Than Or Equal To Operator

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.
image

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:

Hi!
It’s giving you the result for the console.log in your last line.
If you change it to console.log(testGreaterOrEqual(10)) it will work :slightly_smiling_face:

Thank you for the clarification. Have a good day!

Cheers,
SJ