I can't do lesson 68 of unit 1 for js

it won’t let me run the test, not even to see what items fail, was it bugged?

Hi @mayrazapatautn!

In order to better assist you we will need the link for the challenge and your code.

Thanks!

1 Like
function testElse(val) {

  var result = "";

  if (val > 5) {

    result = "Bigger than 5";

  } else (val <= 5) {

    result = "5 or Smaller";

  }

  return result;

}

testElse(4);
1 Like

Thank you for giving me your code.

The issue is here.

When you have an else statement, you are not supposed to have this condition written out here

The way the if/else statement works is the computer will first check the condition in the if statement (val > 5) and if that is false then it will go the else block.

If you think about it, either the number is greater than 5 or else it is not.
So there is no need to explicity say (val <= 5)

Make sense?

This is the proper way to write an if else statement

FCC sample:

if (num > 10) {
  return "Bigger than 10";
} else {
  return "10 or Less";
}
2 Likes

Thank you very much, it seems that I was confused with another language at the time haha