diff --git a/main.js b/main.js index 157e0f0..9cd7b5b 100644 --- a/main.js +++ b/main.js @@ -94,6 +94,18 @@ function cardsleft(){ function addScore(num){ playerCards.push(num); + //? Filters out Aces + const withoutAces = playerCards.filter(e => e !== 'A'); + + const count = playerCards.length-withoutAces.length; + + //? Adds the aces to the end + for(let i=0; i { if(e === 'A'){