Build a Card Counting Assistant - Build a Card Counting Assistant

Tell us what’s happening:

Hey, I need help on my Counting Card Assistant lab. I have my code written down, but all the tests except for 8 and 9 are checked. I have no idea what I need to do, so some help would be much appreciated. Don’t give me the answer, but instruct on how to solve the issue. Thanks!

Your code so far

let count = 0

function cc(card) {
  switch (card) {
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      count ++;
      break;
    case 7:
    case 8:
    case 9:
      break;
    case 10:
    case "J":
    case "Q":
    case "K":
    case "A":
      count --;
      break;
  }
  if (count >= 2 && count <= 10) {
    return `${count} Bet`;
  } else {
    return `${count} Hold`
  }
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0

Challenge Information:

Build a Card Counting Assistant - Build a Card Counting Assistant

https://www.freecodecamp.org/learn/full-stack-developer/lab-counting-cards/lab-counting-cards

so what should happen if count is 1, or 11?, are those both a situation in which to Hold?

read again the requirements and try to answer

Thanks for the help! I figured out the bug in my code. The cc() function needed to return “Bet” if count was greater than 0.