Tell us what’s happening:
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;
}
testElse(4);
The above is my answer.
There must be a bug, i even tried to copy past the answer from the forum into the box but it still comes back with:
// running tests
testElse(4)
should return “5 or Smaller”
testElse(5)
should return “5 or Smaller” // tests completed
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;
}
testElse(4);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36
.
Challenge: Introducing Else Statements
Link to the challenge: