Once shuffled, most card decks are dealt from the top down the array (unless we tell our AI differently! HINT). What this means is we can use an Array's pop() method to deal with those cards. The JavaScript "pop() method" removes the last item added into an Array and will return that item to the caller, which is the exact scenario we have here.
function dealCard(deck){
return deck.pop();
}
let card = dealCard(deck1);
console.log(card); // for debugging or possibly PBM or PBeM games?