Introducing Else Statements
Summary
- The
else
statement is used when anif
statement is nottrue
.
Final Code
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);