Basic JavaScript - Comparison with the Less Than Or Equal To Operator

Tell us what’s happening:
what does “testLessOrEqual(10);” stand for i this code

Your code so far

function testLessOrEqual(val) {
  if (val <= 12) {  // Change this line
    return "Smaller Than or Equal to 12";
  }

  if (val <= 24) {  // Change this line
    return "Smaller Than or Equal to 24";
  }

  return "More Than 24";
}

testLessOrEqual(10);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0

Challenge: Basic JavaScript - Comparison with the Less Than Or Equal To Operator

Link to the challenge:

That is simply calling the function testLessOrEqual with the value 10 passed to the function.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.