Basic JavaScript - Introducing Else Statements

Tell us what’s happening:
Hi, I’m having trouble with this test. It keeps giving me an error that says “You should not change the code above or below the specified comments”. How can I fix this?

Your code so far

function testElse(val) {
  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

Your browser information:

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

Challenge: Basic JavaScript - Introducing Else Statements

Link to the challenge:

You changed the code above this line.

I suspect you copied an old answer you found. I strongly recommend against doing that.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.