Counting cards solution problem

Tell us what’s happening:
Describe your issue in detail here.
There’s no way this code is wrong. Please can someone check it out for me

  **Your code so far**

let count = 0;

function cc(card) {
// Only change code below this line
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 'J':
case 'Q':
case 'K':
case 'A':
if(count=1 || count>1){
return count + " Bet"
  return count + " Hold"

return "Change Me";

// Only change code above this line

cc(2); cc('J'); cc(9); cc(2); cc(7);
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Safari/537.36

Challenge: Counting Cards

Link to the challenge:

You left in the return "Change Me"; piece at the end. Remove that and see if it works.

How do you check equality of two values in JavaScript?

1 Like

To build on this point, this code:

can be shortened with >= and eliminate ||. But that is a tip, not the problem.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.