freeCodeCamp Challenge Guide: Introducing Else Statements

When I run the code in the console the result is “5 or smaller”. Yet the “Run Test” function says testElse(5) should return “5 or Smaller” and won’t pass. Must be a :bug:

  var result = "";
  // Only change code below this line
  
  if (val > 5) {
    result = "Bigger than 5";
  } 
  
  else {
    result = "5 or smaller";
  }
  
  // Only change code above this line
  return result;
}

// Change this value to test
testElse(5);
12 Likes