Counting Cards Challenge - Stuck

What do i wrong here?:

``````
var count = 0;

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

return "Change Me";
// Only change code above this line
}

// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
``````

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

``````if (count > 1) {
return 2, 3, 4, 5, 6 + " Bet";
``````

This part of your code means, `if the count is greater than one, return the integers 2, 3, 4, 5, 6 and the string Bet`.

The challenge is only looking for something like the following to be returned:

Example Output

`-3 Hold` or `5 Bet`

Also, I donâ€™t see where youâ€™re updating the `count` variable in your code, as stated in the challenge instructions:

â€¦ increment or decrement the global `count` variable according to the cardâ€™s value (see table).

Read through the challenge instructions again and let me know what parts you need help with.

I have changed my code:
I think it is working now?

``````var count = 0;

function cc(card) {
// Only change code below this line
if (card > 0) {
count++;
return 2, 3, 4, 5, 6 + " Bet";
} else if (card == 0) {
return 7, 8, 9 + " Hold";
} else if (card < 0) {
count--;
return 10, 'J', 'Q', 'K', 'A' + " Hold";
}

return card;
// Only change code above this line
}
``````

Nope it doesnâ€™t works.

1 Like

Youâ€™re taking a bit of a wrong approach. I recommend you look through this topic as Iâ€™ve already explained some things there, one of the users also had a problem with completing this challenge:

1 Like

``````return 2, 3, 4, 5, 6 + " Bet";
As a hint, in my tests, it will always return `6 Bet` regardless of the value of `count` or anything else.