Counting Cards gone wrong :(

Tell us what’s happening:

``````
var count = 0;

function cc(card) {
// Only change code below this line
if(card<7){card =+1;}
else if(card>6){card =+0;}
else switch(card){
case "10":
case "J":
case "Q":
case "K":
case "A":
card =-1;
}
if(card%0){
return "Bet";
}
else return "Hold";
}

// 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/67.0.3396.99 Safari/537.36`.

OK,

There are a lot of little problems here.

First of all, on lines like:

`````` if(card<7){card =+1;}
``````

There is no operator `=+` - you mean ‘+=’

Also, on the line:

``````else if(card>6){card =+0;}
``````

even if the operator was right, it is pointless to add 0.

``````   case "10":
``````

That card will be sent as a number, not a string.

``````if(card%0){
``````

I’m not sure what this is checking. mathematically. You want to check if count is greater than `0`.

`````` if(card%0){
return "Bet";
}
else return "Hold";
}
``````

Read the instructions more carefully, it’s supposed to be the count followed by a space and then the message.

OK, so your “logic” is a little messy, choose between `if/else` or `switch`. You just learned about `switch` and it makes the code more intuitive here, so that is a good idea.

Remember that you can have multiple cases. And you also have a default case for anything left over. Consider the following function:

``````function isAVowel(letter) {
switch (letter.toLowerCase()) {
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
break
case 'y':