JavaScript básico - Conteo de cartas

Tell us what’s happening:

no logro entender por que el código estaría incorrecto

Your code so far

let count = 0;

function cc(card) {
  // Cambia solo el código debajo de esta línea
if (card == 2 || card == 3 || card == 4 || card == 5 || card == 6) {
        return ++count;
    } else if (card == 10 || card == "J" || card == "Q" || card == "K" || card == "A") {
        return --count;
    }

var holdbet = 'Hold'
  if (count > 0) {
    holdbet = 'Bet'
  }

  return count + " " + holdbet;
  // Cambia solo el código encima de esta línea
}

cc(2); cc(3); cc(7); cc('K'); cc('A');

Your browser information:

El agente de usuario es: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15

Challenge Information:

JavaScript básico - Conteo de cartas

Hey @Carolisa
Please change this

count ++

and
count--

Hope it helps

thanks! I did the change but still doesn’t work

Hey @Carolisa
I will highlight where there is a problem in you code the you will try work it out

You need to get rid of those return statements just increment or decrement the count without returning them.

Then you need to declare your variable at the top of your function then you need to set it as you would set the count like after every condition you set the variable

Hope you understand

thank you! I manage to do it right with the comments you send me! <3

Me alegro que pudieras conseguir el resultado! animos!