Basic JavaScript - Comparison with the Greater Than Operator

Tell us what’s happening:

Describe your issue in detail here.

Your code so far

function testGreaterThan(val) {
  if (val >100) {
    // Change this line
    return "Over 100";
  }

  if (val >10) {
    // Change this line
    return "Over 10";
  }

  return "10 or under";
}

// Change this value to test
console.log(testGreaterThan(10));
// console.log(testGreaterThan(0));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36

Challenge Information:

Basic JavaScript - Comparison with the Greater Than Operator

1 Like

check if val is less than or equal to 10,and return the string “10 or Under.”
Hope this helps…

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