Can you please help me idk what wrong w/ my code

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

let count = 0;

function cc(card) {
  // Only change code below this line
    if (card >= 2 && card <= 6){
      count ++;
    }
    else if (card >= 7 && card <= 9){
      count ;
    }
    else {
      count --;
    }
    if (count > 1){
      return count += " Bet";
    }else{
      return count += " Hold";
    }

  
  // Only change code above this line
}





      **Your browser information:**

User Agent is: <code>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36 Edg/96.0.1054.62</code>

**Challenge:**  Counting Cards

**Link to the challenge:**
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/counting-cards

You definitely do not want to declare the function cc inside of the function cc. There should only be one function declaration of cc.

ohh sry i’m did’t see . wrong copie man

i’m edit now can you please watch again .

Put the following right before the if/else that returns the string:

console.log('count = ', count);

And then run the tests again and look at the console output in the pane below the editor. What do you think would be causing the issue with the count variable?

1 Like

Thx you sir. it worked!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.