Not Working -- Why?

Tell us what’s happening:
Don’t understand why this is not working when I test for 4 or 5.

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

testElse(4);

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
testElse(4);

Your browser information:

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

Challenge: Introducing Else Statements

Link to the challenge:

testElse(4) should return “5 or Smaller”

do you see the difference?

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

Yes, I can see the difference. I should use a capital S. Thank you. It worked!

Thank you. Will follow this procedure next time.