Basic JavaScript - Returning Boolean Values from Functions

Tell us what’s happening:

I’m getting these two error messages and I’m not sure what I’m doing wrong here.

  • isLess(15, 10) should return false

  • Failed:You should not use any if or else statements

Your code so far

function isLess(a, b) {
  // Only change code below this line
  if (a < b) {
      return a < b;
  } 
  // Only change code above this line
}

isLess(10, 15);
function isLess(a, b) {
  // Only change code below this line
  if (a < b) {
      return a < b;
  } 
  // Only change code above this line
}

isLess(10, 15);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36

Challenge Information:

Basic JavaScript - Returning Boolean Values from Functions

Never mind I was able to figure this out on my own

1 Like

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