Syntax error that I can't seem to find

Tell us what’s happening:
there’s a syntax error on line 5 but I used the same formula for all of them i assume this runs through the entire script

Your code so far

var count = 0;

function cc(card) {
// Only change code below this line
case card = 2,3,4,5,6:
  count + 1;
case card = 7,8,9:
  count = count;
case card = 10,'J','Q','K','A':
  count -1;

return "Change Me";
// 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/86.0.4240.198 Safari/537.36 Edg/86.0.622.69.

Challenge: Counting Cards

Link to the challenge:

This is not the correct syntax for switch statements.

This is not correct syntax for incrementing a variable.

This is not correct syntax for decrementing a variable.

This is not the correct return value.

is it supposed to be an array? because I tried and it didn’t work

When in doubt, read documentation or previous lessons

1 Like