Build a Card Counting Assistant - Build a Card Counting Assistant

Tell us what’s happening:

I don’t understand why whatever card is used the count always goes up

Your code so far

let count = 0;


function cardCounter(card) {
  if (card === 2 || 3 || 4 || 5 || 6){
    count += 1
  } else if (card === 10 || "J" || "Q" ||"K" || "A") {
    count  -= 1
  }

  if (count > 0){
    return `${count}  Bet`;    
  } else {
    return `${count}  Hold`;
  }

}

console.log(cardCounter(3));
console.log(cardCounter("J"));

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0.1 Safari/605.1.15

Challenge Information:

Build a Card Counting Assistant - Build a Card Counting Assistant

Look at your if lines: make sure you compare card to each value (not || 3 || 4 ...), and return the result with exactly one space.

this does not do what you mean
the || wants full expressions on each side, this means that this is evaluated as
(card === 2) || (3) || (4) || (5) || (6) and 3 is truthy, so the condition is truthy and the content of this if is executed