Build a Card Counting Assistant - Build a Card Counting Assistant

Tell us what’s happening:

Hello,i need help,what’s wrong with my code?
thanks

Your code so far

let count = 0
function cardCounter (card) {
  if (card >= 2 && card <= 6) {
    count ++}
} else if (card === 10 || card === "J" 
|| card === "Q" || card === "K" || card === "A") {count --}
}
if (count > 0) {
  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/147.0.0.0 Safari/537.36

Challenge Information:

Build a Card Counting Assistant - Build a Card Counting Assistant

Hi @iman12

There is a syntax error, a message is in the console.

SyntaxError: unknown: Unexpected token (5:2)

  3 |   if (card >= 2 && card <= 6) {
  4 |     count ++}
> 5 | } else if (card === 10 || card === "J" 
    |   ^
  6 | || card === "Q" || card === "K" || card === "A") {count --}
  7 | }
  8 | if (count > 0) {

Happy coding