Tell us what’s happening:
I have been tryong for over three week now what is that I’m not doing right.
Your code so far
let count = 0
function cardCounter(card)
{
if(card <= 0){let count = card -1; }else if( card >= 1){let count = card + 1} else if (card === 6){ let count = "5 Bet" }
;return `${count} Hold` && `${count} Bet`
}
cardCounter(3)
console.log(cardCounter(3))
Your browser information:
User Agent is: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Mobile Safari/537.36
Challenge Information:
Build a Card Counting Assistant - Build a Card Counting Assistant
ILM
February 24, 2026, 5:31pm
2
Your code is really hard to read, you may want to use conventional formatting
then you need to take note that you are asked to update the global count variable, not create a new one
also take a note that you are always asked to increase or decrease it by 1 (or leave it unchanged), not update it to be card -1 or card + 1 or 5 Bet
and once you have changed count, you need to create the output of the function based on the current value of count
I have updated the code ,so far am I heading in the right direction?
I m just not sure if it is show on yoir side how gar I am.
ILM
February 25, 2026, 8:36pm
4
can you show your updated code?
Tell us what’s happening:
I’m not understanding the instructions of 6 , 7,8 .Either then that everything is responding.
What should I do with with these instructions.
Your code so far
let count = 0
function cardCounter(card){
if(card <= 5){count = card + 1}else if(card === 6){ count = 5 }else if(card === 9){count = 0}else if(card === "A"){count = -5}else if(card === 10 || "J" || "Q" || "K"){count = - 1};
if (count >= 1){ count = count + " Bet"} else (count = count + " Hold"); return count }
cardCounter(5)
console.log(cardCounter(5))
Your browser information:
User Agent is: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Mobile Safari/537.36
Challenge Information:
Build a Card Counting Assistant - Build a Card Counting Assistant
dhess
February 27, 2026, 4:33pm
6
What user story is this code implementing?
There is an instruction for card 6 to return 5 Bet and for “A" to return -5Hold . That us how implemented them do they need be removed
ILM
February 27, 2026, 5:51pm
8
I went ahead and combined your posts for you. In the future, just reply to the original thread to add further updates.
Thanks.
1 Like
dhess
February 27, 2026, 6:03pm
9
It sounds like you are trying to hard code a returned result based on what is expected for specific values. But that’s not solving the problem in the general sense. What happens if the expected result is something different? Your code should be able to handle any test input.
Please try again.
Read the user stories again carefully and implement them in your code. Don’t code based on expected test results.
User stories 5-7 are telling you what to update count by for each card value.
If you need more help, please post your updated code.