Returning Boolean Values from Functions '===' point?

I am confused as to why we are learning about the is equal to(and of the same type) operator ‘===’ if it isn’t utilized in the challenge of this lesson?

It kind of throws you off a bit. Making the whole point of the lesson counterproductive. Therefore, there must be a way to solve this challenge using the === sign. I would love to see how if anybody has any ideas.

Your code so far

  // Fix this code
  
  return a < b;
  
  
}

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

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36.

Link to the challenge:
https://www.freecodecamp.org/challenges/returning-boolean-values-from-functions

It’s an example, just like when you’re given example code that shows you how to color an element red and then asked to color an element blue. The strict equality operator is covered in a previous lesson. The purpose of this lesson is learning how to directly return a boolean result without using if statements.

If you really want to use === in your answer, you could do this:

Spoiler
return a < b === true;

However, it’s redundant.

2 Likes

Thank you for taking the time to reply.