scrimba
Learn JavaScript
Blackjack
The if...else statement for our game
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

The if...else statement for our game
AboutCommentsNotes
The if...else statement for our game
Expand for more info
index.js
run
preview
console
let firstCard = 10
let secondCard = 7
let sum = firstCard + secondCard

// Write the conditional according to these rules:

// if less than or equal to 20 -> "Do you want to draw a new card? 🙂"
// else if exactly 21 -> "Wohoo! You've got Blackjack! 🥳"
// else -> "You're out of the game! 😭"

Console
/index.html
-1:59