scrimba
Learn JavaScript
Blackjack
Link to stylesheet
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
Link to stylesheet
Expand for more info
index.js
run
preview
console
let firstCard = 10
let secondCard = 4
let sum = firstCard + secondCard
let hasBlackJack = false
let isAlive = true
let message = ""

if (sum <= 20) {
message = "Do you want to draw a new card? πŸ™‚"
} else if (sum === 21) {
message = "Wohoo! You've got Blackjack! πŸ₯³"
hasBlackJack = true
} else {
message = "You're out of the game! 😭"
isAlive = false
}

console.log(message)
Console
β€Ί
"Do you want to draw a new card? πŸ™‚"
,
/index.html
-2:32