Basic JavaScript - Counting Cards

Why doesnt my code work ? It returns the correct value however it says the task is not completed? Any issues with my code? What’s wrong? Works pretty well to me

Your code so far

let sum = 0;
function cc(card) {
  // Only change code below this line
if (card >=2 && card <=6) {
  sum +=1;
else if (card >6 && card <=9) {
else {
  sum -=1;
var n = ''
  if (sum > 0) {
    n = ' Bet'
  return sum + nig}
  else if (sum <= 0) {
    n = ' Hold'
  return sum + n};

cc(1); cc(1); cc(1); cc(1); cc(5);

Challenge: Basic JavaScript - Counting Cards

Link to the challenge:

You should be using the variable count in this exercise, not sum.
Also, you have a typo in this line:

return sum + nig

Fix those things and your code should pass the challenge.

You did not follow the instructions. Why did you change the global variable named count to sum? You should not have done that.

thanks, did not see the count variable at the start so i created my own then deleted the ‘count’ var and replaced it with my own.
works now tho