codedamn

Chaining If Else Statements

Created by Codedamn about a year ago

0

No description provided

2 Comments

    0

    Solution : 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 "Medium" }else if(num<20){ return "Large" }else if(num>=20){ return "Huge" }

    return "Change Me"; // Only change code above this line }

    testSize(7);

    @anamuddinahmad

    Anamuddin Ahmad

    @anamuddinahmad

    0

    You should have at least four else statements

    You should have at least four if statements

    You should have at least one return statement

    testSize(0) should return "Tiny"

    testSize(4) should return "Tiny"

    testSize(5) should return "Small"

    testSize(8) should return "Small"

    testSize(10) should return "Medium"

    testSize(14) should return "Medium"

    testSize(15) should return "Large"

    testSize(17) should return "Large"

    testSize(20) should return "Huge"

    testSize(25) should return "Huge

    @yashraj2043

    Yash Raj Sen

    @yashraj2043

Your comment