Construir un Asistente de Conteo de Cartas. - Construye un Asistente para Contar Cartas

Cuéntanos qué está pasando:

Pues el problema me lo conto como resuelto pero me gustaria saber si realmente esta bien hecho asi o si se debio de hacer de otra manera ya que al pedir cardCounter(6) deberia de dar como resultado 5 Bet y mi resultado da 1 Bet, pero realmente no entendi bien el problema pero se me dio solucion a lo que realice ya que eso fue lo que entendi

Tu código hasta el momento

let count = 0
function cardCounter(card) {
   if (card == 1 || card == 2 ||card == 3 ||card == 4 ||card == 5 ||card == 6 ) {
     count = count + 1

   }else if (card >= 7 && card <= 9){
     count += 0

   }else if (card == 10 || card == "J" ||card == "Q" ||card == "K"||card == "A"){
     count = count - 1

   }else {
    return "not value, insert"
   }


  if (count >= 1){
    return count + " Bet"
  }else if (count <= 0 ){
    return count + " Hold"
  }


}

console.log(cardCounter(9))

Información de tu navegador:

El agente de usuario es: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36

Información del Desafío:

Construir un Asistente de Conteo de Cartas. - Construye un Asistente para Contar Cartas

GitHub Link: i18n-curriculum/curriculum/challenges/espanol/blocks/lab-counting-cards/68a23004e96a105df3a21fc4.md at main · freeCodeCamp/i18n-curriculum · GitHub

Hi @Samm0916,

Since you have posted a working solution for which you are requesting code feedback, we have blurred your code so that users who have not completed this challenge can read the discussion in this thread without giving away the solution.

Happy coding!

Después de las cartas 2 , 3 , 4 , 5 , entonces llamar a cardCounter(6) debería devolver la cadena 5 Bet .

It does not mean cardCounter(6) on its own

it means that first there was cardCounter(2), then cardCounter(3), then cardCounter(4) and then cardCounter(5), but these are not tested. And only after these there is cardCounter(6)