Tell us what’s happening:
Please dont kick me off for asking too many questions!! I havent coded in a long time and im reallllllllyyyy trying to research, fix, and ask for help before just going straight to the solution. thank you!!
Your code so far
var count = 0;
function cc(card) {
// Only change code below this line
switch(card){
case 2: count++;
case 3:count++;
case 4:count++;
case 5: count++;
case 6: count++;
break;
case 10: count--;
case 'J':count--;
case 'Q':count--;
case 'K':count--;
case 'A':count--;
}
if (count>0){
return count," ",'Bet';
}else if(count<=0){
return count," ",'Hold';
}
// Only change code above this line
}
// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/counting-cards/