Count Change Cards
+1 2, 3, 4, 5, 6.
0 7, 8, 9.
-1 10, 'J', 'Q', 'K', 'A'
if the card is positive //2,3,4,5, or 6
it should return count + " Bet".
and if the card is // 10, ‘J’, ‘Q’, ‘K’, or ‘A’,
it should return count + " Hold"
**Your code so far**
let count = 0;
function cc(card) {
// Only change code below this line
const Low = [2,3,4,5,6];
const High =[10,'J', 'Q','K','A']
if(Low.includes(card)){
count++;
}else if(High.includes(card)){
count--;
}
if(Low <= 0){
return count + " Bet";
}else{
return count + " Hold";
}
// Only change code above this line
}
cc(2); cc(3); cc(7); cc('K'); cc('A');
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36
Challenge: Counting Cards
Link to the challenge: