Returning Boolean Values from Functions : with switch ()?

Tell us what’s happening:

Hi, Can I use switch() to replace if-else loop in this case?

Your code so far

function isLess(a, b) {
  // Fix this code
     a < b;
     return true;
     return false;

// Change these values to test
isLess(10, 15);

Your browser information:

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

Link to the challenge:

A switch statement takes a value or expression between the ( ). You attempted to add two values which is not possible. You could use the value true and then your cases would need to evaluate to true or false depending what you want to return. For what the challenge expects you to do, a Switch statement is overkill. A simple if statement or better yet the use of a ternary operator would be much simpler. Using a ternary operator, this challenge can be solved in a single return statement line. Using an if statement, it can be solved in 3 lines.

I haven’t studied ternary statement yet. Can you give me an example?

You will get to it in the curriculum later. Just focus on an if statement solution for now. You will not need an else statement.