scrimba
Learn Basic JavaScript
Chaining If Else Statements
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Chaining If Else Statements
AboutCommentsNotes
Chaining If Else Statements
Expand for more info
index.js
run
preview
console
function testSize(num) {


return "Change Me";
}

testSize(7);

/*
Write chained if/else if statements to fulfill the following conditions:

num < 5 - return "Tiny"
num < 10 - return "Small"
num < 15 - return "Medium"
num < 20 - return "Large"
num >= 20 - return "Huge"
*/
Console
"Less than 5"
,
index.html
-2:56