let firstCard = 10 let secondCard = 11 let sum = firstCard + secondCard + 4 let hasBlackJack = false let isAlive = true
if (sum <= 20) { console.log("Do you want to draw a new card? ๐") } else if (sum === 21) { console.log("Wohoo! You've got Blackjack! ๐ฅณ") hasBlackJack = true } else { console.log("You're out of the game! ๐ญ") isAlive = false }
console.log(isAlive)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
let firstCard =10
let secondCard =11
let sum = firstCard + secondCard +4
let hasBlackJack =false
let isAlive =true
if (sum <=20) {
console.log("Do you want to draw a new card? ๐")