Tell us what’s happening:
I don’t understand how to make the if / else statement execute and to get it to display the current count with either “Bet” or “Hold”
Please help!!
Your code so far
let count = 0;
function cc(card){
switch(card){
case 2:
case 3:
case 4:
case 5:
case 6:
return count + 1;
break;
case 7:
case 8:
case 9:
return count;
break;
case 10:
case "J":
case "Q":
case "K":
case "A":
return count - 1;
}
if(count <= 0){
return`${count} Hold`;
}else{
return `${count} Bet`;
}
}
console.log(cc(2));
console.log(cc(3));
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36
Challenge Information:
Build a Card Counting Assistant - Build a Card Counting Assistant