Tell us what’s happening:
Dear All,
Good nights,
I´m having troubles solving this challenge, would anyone please give me some orientation about how to solve it, i don´t understand basically how to put 5 and Bet together,
i tried to put : result 5 + “Bet”; (but it did not work),
thank you so much in advance to you all,
Kind regards,
Ivonne
Your code so far
var count = 0;
function cc(card) {
// Only change code below this line
if (card >= 2 && card <= 6 ){
count ++;
}
else if (card >= 7 && card <= 9){
count = 0;
}
else if (card == 10 || card == 'J' || card == 'Q'|| card == 'K' || card == 'A'){
count --;
}
if (card >= 2 && card <= 6){
return count;
}
if (count >= 0){
return count + "Bet";
}
else if (count <= 0) {
return count + "Hold" ;
}
else 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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/counting-cards