can anyone kindly put me through this code, I have reviewed it a dozen times ,yet, I cant pass this test
**Your code so far**
var count = 0;
function cc(card) {
switch(card){
case 2:
case 3:
case 4:
case 5:
case 6:
count ++;
break;
case 10:
case "J":
case "Q":
case "K":
case "A":
count --;
break;
}
var holdbet = "Hold";
if (count > 0){
holdbet = "Bet";
}
// Only change code below this line
return count + "" + holdbet;
// 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/89.0.4389.90 Safari/537.36.
Please stop posting in random threads offering to give solutions.
Instead of posting your full working solutions, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.
//Include the Mid Cards
case 7:
case 8:
case 9:
count+= 0;
break;
//Make it a habit to use a ‘default’; the reason behind is that “what if ?” the end-user entered an invalid input, then without a ‘default’ return value – that would be misconstrued as a ‘valid Mid Card’.
default:
return card value "${card}" is not valid! Serve another card!;
//It’s best practice to include ‘else’ when using ‘if’; this gives you a better logical ‘visual’; although, js is very ‘forgiving’ and would allow the absence of ‘else {}’.
It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.
We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.