Workshop › Blackjack › Step 4 of 22
You and the dealer each get two cards from the top of the deck. The top is the end of the list: pop takes it off.
```js
let player
let dealer
const nextCard = () => deck.pop()
function deal() {
player = [nextCard(), nextCard()]
dealer = [nextCard(), nextCard()]
}
deal()
```pop removes the last card of the list and returns it, so the deck gets smaller.deck, write player and dealer.newDeck, write nextCard and deal.deal() after newDeck().Skills: Arrays and objects, Functions
← Shuffle Cards on the table →