Kindly Help please... what is going on here... i have just two more to pass(Counting Cards)

Kindly Help please... what is going on here... i have just two more to pass(Counting Cards)
0

#1

1… Cards Sequence 2, J, 9, 2, 7 should return 1 Bet
2…Cards Sequence 2, 2, 10 should return 1 Bet

var count = 0;

function cc(card) {
  // Only change code below this line
  if(card > 1 && card < 7) {
    return ++count + " " + "Bet";
  } else if (card < 10) {
    return count + " " + "Hold";
  } else {
    return --count + " " + "Hold";
  }

	
  
  
  // Only change code above this line
}


// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/counting-cards/


#2

Are you supposed to immediately “Bet” after you count up? Or are you supposed to “Bet” if your count is positive? Same with “Holding”.


#3

I am to Bet if the count is positive please…
and Hold when it’s negative or zero;


#4

You need to separate the logic which increases/decreases the value of count from the logic which decides what value to return. Currently, you are basing your return value on the card value instead of just the count value.


#5

Ok. Then you’ll need to redo your code, because as it is right now, you immediately “Bet” when you have a “count up” card. @randelldawson highlights what you should probably do.


#6

Thanks to You all guys, i used switch instead and it worked. God bless you all for the support.