Basic JavaScript: Counting Cards Help

Hello I want to know why my code won’t work. I feel like the if and else statement are what should work for the last part

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 += 1;
    break;
    case 7:
    case 8:
    case 9:
    count += 0;
    break;
    case 10:
    case "J":
    case "Q":
    case "K":
    case "A":
    count -= 1;
   
   
  }
   if(count <= 0){
      return count + "Hold";
    } else {
      return count + "Bet";
    }
  
  // 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 return value’s format is wrong. Try to log it in console and compare with the requirement.

Is my return statement wrong? I saw some other examples but I feel like this one could also be used

EDIT: Nevermind I figured out that there was a space needed between the strings haha

Hi, I am a JS newbie. My understanding of the scripting language is advancing. So my question here is - since the count variable was declared as global scope, how is it that when the function cc was initiated, that the count variable can be used with the local scope of that function?

along with:

Okay, so a local variable won’t be able to use a global scope variable.

I am having trouble the concept of console.log()
Could you please explain how you would log this example into the console?
Thank you!

I don’t know what you actually mean, you can just type console.log(whatever) and it will be logged in the console. If you still have question, you can paste your code here and let us see what is going wrong.