scrimba
Learn JavaScript
Practice part 2
if else
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

AboutCommentsNotes
if else
Expand for more info
index.js
run
preview
console
let age = 15

// less than 6 years old -> free
// 6 to 17 years old -> child discount
// 18 to 26 years old -> student discount
// 27 to 66 years old -> full price
// over 66 years old -> senior citizen discount

// Create a conditional statement (if/else/else if) that logs out the discount
// the passenger will get based upon the value of the age variable
Console
/index.html
-2:48