Basic JavaScript - Introducing Else If Statements

I think I messed up with this code. The instructions are in the screenshot I attached with post. Somebody should please help

Your code so far

function testElseIf(val) {
  if (val > 10) {
        return "Greater than 10";
          } else if (val < 5) {
              return "Smaller than 5";
                } else {
                    return "Between 5 and 10";
                }

testElseIf(7);

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 13; 23028RNCAG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Mobile Safari/537.36

Challenge: Basic JavaScript - Introducing Else If Statements

Link to the challenge:

Let’s format this

function testElseIf(val) {
  if (val > 10) {
    return "Greater than 10";
  } else if (val < 5) {
    return "Smaller than 5";
  } else {
    return "Between 5 and 10";
  }

This should help you see that you are missing something!

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