Workshop › Blackjack › Step 17 of 22
An ace and a ten-card as your first two cards is a "blackjack", the best hand. It ends the round at once and pays two and a half times the bet. If the dealer has one instead, you lose at once; if both do, it's a push.
```js
const isBlackjack = (hand) => hand.length === 2 && handValue(hand) === 21
if (isBlackjack(player) || isBlackjack(dealer)) finish()
if (isBlackjack(player) && isBlackjack(dealer)) [message, paid] = ['Both blackjack: push', bet]
else if (isBlackjack(player)) [message, paid] = ['Blackjack!', bet * 2.5]
else if (isBlackjack(dealer)) message = 'Dealer blackjack'
else if (p > 21) message = 'Bust!'
```finish, so they beat an ordinary 21.deal, write isBlackjack.deal, finish at once on a blackjack.finish, put the three blackjack checks first, and turn the bust if into else if.Skills: Game states
← The next round Your record →