I dont know why this is not working please tell me my mistake am stuck on this its been 2 days

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

var count = 0;

function cc(card) {
// Only change code below this line
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'
}
return count + " " + holdbet;
}
// Only change code above this line


cc(2); cc('K'); cc(10); 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/93.0.4577.63 Safari/537.36

Challenge: Counting Cards

Link to the challenge:

console.log("Card: '2',  Expected: '1 Bet',   Obtained: '" + cc(2) + "'");
console.log("Card: 'K',  Expected: '0 Hold',  Obtained: '" + cc('K') + "'");
console.log("Card: '10', Expected: '-1 Hold', Obtained: '" + cc(10) + "'");
console.log("Card: 'K',  Expected: '-2 Hold', Obtained: '" + cc('K') + "'");
console.log("Card: 'A',  Expected: '-3 Hold', Obtained: '" + cc('A') + "'");

add this at the end of your code, in place of the function calls that are now present, and see if you can figure out what’s failing

i am really sorry, i dont get it , please tell me where should i do correction?

Hi @meghakumari7786 !

Welcome to the forum!

Look very carefully to this line here

Capitalization matters

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.