Help me on this Counting Card Challange

I created i function that return the final count value when you call add/substract function multiple times, but all i’ve done was need to return count multiple times too which is break the rules of the challange. how can i return only the last countvalue?

Here is my code

// js

var count = 0;

function cc(card) {
// Only change code below this line
if (card > 1 && card < 7) {
} else if (card == 10 || card == 'J' || card == 'Q' || card == 'K' || card == 'A') {

if (count > 0) {
    return console.log(count + ' Bet');
} else {
    return console.log(count + ' Hold')
// 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.120 Safari/537.36.

Challenge: Counting Cards

Link to the challenge:

the returned value from console.log is undefined, so the function is returning undefined

you can’t do return console.log(...)

the fact that each function call should return the current value of count is correct, don’t worry

well i tried to use vscode to solve the challange which is i have to run these code on browser and use console for check the output. thanks you woke me up XD

to see what a function is returning, do console.log(myFunc()) instead