Build a Card Counting Assistant - Build a Card Counting Assistant

Tell us what’s happening:

I don’t understand how I don’t past it, since the message for the console is just unexpected token at line 2:45 (I know 2 means line 2, but I never know what the number after means).

Your code so far

let count = 0;
function cardCounter(card) {if (card >= 2 && <= 6) {count++;}
  else if (card === 10) ||
card = "J" ||
card = "K" ||
card = "Q" ||
card = "A" { count--;}}
if (count > 0) { return count + " Bet";} else {return count + " Hold";}



Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0

Challenge Information:

Build a Card Counting Assistant - Build a Card Counting Assistant

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-counting-cards/68a23004e96a105df3a21fc4.md at main · freeCodeCamp/freeCodeCamp · GitHub

It means the position within the line.

Also, don’t forget what ILM pointed out about right-clicking and selecting “Format Document” to format your code.

ah, could you precise where in the line, I did that but for me it looked messed up for some reasons.

code formated

let count = 0;
function cardCounter(card) {
  if (card >= 2 && <= 6) { count++; }
  else if (card === 10) ||
    card = "J" ||
      card = "K" ||
        card = "Q" ||
          card = "A" { count--; }
}
if (count > 0) { return count + " Bet"; } else { return count + " Hold"; }

what is this doing? 

And is that inside your if statement?

the console provides nothing. to help… is a variable should I had a let? Edit didn’t help.

you are not creating a variable with this, are you? card already exists

what is =? what does it do?

i guess I should probably just reread everything…

i know the equal check for equality or smth… I thought Javascript was simpler but nope…

and they do not exist… the cards anyway gotta go eat.

it seems you may need to review the difference between assignment operator and equality operator, because card = "J" is not checking for equality

it check if it’s false or true?
still don’t get it… English is hard…

Please review this theory lecture about Booleans and equality operators:

Working with Comparison and Boolean Operators - What Are Booleans, and How Do They Work with Equality and Inequality Operators? | Learn | freeCodeCamp.org

no, it’s not, = is assignment operator

please review the difference between assignment operator and equality operator

I’m neurodivergent so their way they explain it doesn’t help. sometimes a reformulation helps. and sometimes there’s no enough pratice.
Also English = 2nd language.

there are three operators that use the = symbol: = and == and ===

== and === are similar, but to avoid some pitfalls, it is recommented you always use the strictly equal operator ===

you have used the = assignment operator here

oh… that makes more sense now…

but now it’s saying I have missing semi colons. maybe the lab is bugged itself?

since the first test is to declare a variable named count that is set to 0 so now even the first step doesn’t past.
link to lab in case your forgot the instruction /lighthearted https://www.freecodecamp.org/learn/javascript-v9/lab-counting-cards/lab-counting-cards

please post your updated code, I can’t know what else is happening otherwise

There are two ways you can format your code to make it easier to read and test:

  1. After you copy/paste your code into the editor, select it by dragging your cursor over it then click the (</>) button in the toolbar to automatically wrap your code in backticks. (You can click on the animated demo image below to enlarge it.)

  1. Manually add three backticks on a new line above your code and on a new line after your code. Note that a backtick is NOT the same as a single quote('). To find the backtick key on your keyboard, see this post.

To see changes to your post as you make them, you can click the (M+) button on the toolbar to bring up the rich text editor:

I’m just gonna restart it from scratch since now I have a really different code that doesn’t past any test after rereading everything from start and I have no idea in which section they talk about assignments
since honestly I hadn’t changed anything even after trying your stuff. since you need the first thing to be a variable.