Counting Cards , JavaScript challenge

Please guys help, why isn’t my code working because I failed to identify the problem.
Below is the code I have written

// Only change code below this line

if(card === 2|| card === 3||card=== 4||card===5||card===6){

  count = count++;

}else if(card ===7||card ===8||card===9){

  count = 0;

}else if(card ===10||card ==='J'||card ==='Q'||card ==='K'||card ==='A' ){

  count = count--;

}

 else {

count;

}

 var holdbet = 'Hold'

  if (count > 0) {

    holdbet = 'Bet'

  }

  return count + " " + holdbet;

  // Only change code above this line

}

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

these are not the correct ways to increase or decrease countby 1, or to not change it

you may want to review how the shorthand works

2 Likes

Oh,
That’s great but what am I suppose to do now

Oh!
That’s great,
I deleted "count = " , and it worked.

1 Like

good job!

now, to make it even better you could delete the parts of your code that do nothing

1 Like