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