Tell us what’s happening:
What is wrong with my code it doesn’t return below output
testSize(10)
should return the string
Medium
testSize(14)
should return the string
Medium
Your code so far
function testSize(num) {
// Only change code below this line
if(num < 5){
return "Tiny";
}
else if(num < 10){
return "Small";
}
else if(num < 15){
return "Mediam";
}
else if(num < 20){
return "Large";
}
else{
return "Huge";
}
// Only change code above this line
}
testSize(0);
testSize(4);
testSize(5);
testSize(8);
testSize(10);
testSize(14);
testSize(15);
testSize(17);
testSize(20);
testSize(25);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Chaining If Else Statements
Link to the challenge: