Counting Cards lesson Help /*AYUDA*/

Tell us what’s happening:

hola! hice este codigo y funciona!
lo probe en mi editor de codigo usando todas las secuencias de targetas y esta bien. pero la leccion me sigue diciendo esta mal. nesecito ayuda

Hi there! I made this code and it works!
I tested it in my code editor using all the card sequences and it’s fine. But the lesson keeps telling me it’s wrong. I need help

Your code so far

var count = 0;

function cc(card) {
  // Only change code below this line

  
  if(card > 1 && card < 7){
    count++;
  }else if(card == 10 || card == "J" || card == "Q" || card == "K" || card == "A"){
    count--;
  }

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

  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(4); cc(5); cc(6);

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/counting-cards

You don’t have any spaces between count and “Hold” or “Bet”.

1 Like

Yes, I just checked it and I saw it. I am a little distracted. thanks for your answer

Good job on the challenge. Happy coding!

1 Like