Do Comments Get Read by the Grader?

I solved the Basic JavaScript: Returning Boolean Values from Functions with the following solution:

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

// Change these values to test
isLess(10, 15);
console.log(isLess(10, 15) == true);
console.log(isLess(15, 15) == false);
console.log(isLess(7, 4) == false);

Everything seems correct, but the grader tells me it’s incorrect, because the grader/tester didn’t pass the “You should not use any if or else statements” test. So, does the grader/tester read comments?

In some cases the regular expressions used by the tests will not properly exclude text that is in comments.

1 Like