Logical Order in If Else Statements in js

Logical Order in If Else Statements in js
0

#1

Tell us what’s happening:

Your code so far

function orderMyLogic(val) {
  if (val < 10) {
    return "Less than 10";
  } else if (val < 5) {
    return "Less than 5";
  } else {
    return "Greater than or equal to ten";
  }
}

// Change this value to test
orderMyLogic(10);

Your browser information:

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

Link to the challenge:


#2

What is your question about this challenge?


#3


This is my problem what should i do


#4

You have a typo in the string being returned in the last return statement. You changed the original string value. Your current code returns “Greater than or equal to ten” for test case orderMyLogic(11). Compare that with the error message which shows what your code should be returning.


#5

thank you sir, i have solved the challenge