Counting Cards code not working

Please what’s going on guys, this code is supposed to work and let me pass the counting cards level, i have been trying both with switch() statement and it still doesn’t works

My code so far


var count = 0;

function cc(card) {
  // Only change code below this line
  var regEx = /[JQKA]/;
  if(card > 1 && card < 7) {
    count++;
  } else if(card === 10 || String(card).match(regEx) {
    count--;
  }

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

  // Only change code above this line
}

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

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

your else if statement is missing the closing parenthesis in the condition, which will cause errors

fixed that, if you would look at the output of your code, you are missing this:

The current count and the player’s decision ( Bet or Hold ) should be separated by a single space.

Your output of the code you have written is '3Hold'

This wont work:

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

I think you mean count for the condition, also the count++ will cause issues (plus the missing spaces).