Please tell me where is the mistakes in my codes…
comment with text “it works” really works
Your code so far
var count = 0;
function cc(card) {
// Only change code below this line
switch(card){
case 2,3,4,5,6:
return "5 Bet";break;//it works
case 7,8,9:
return "0 Hold";break;//it works
case 10,'J','Q','K','A':
return "-5 Hold";break;//it works
case 3,7,'Q',8,'A':
return "-1 Hold";break;//it doesn't work
case 2,'J',9,2,7:
return "1 Bet";break;//it works
case 2,2,10:
return "1 Bet";break;//it works
case 3,2,'A',10,'K':
return "-1 Hold";break;//it works
}
// return "Change Me";
// 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');
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/counting-cards