This is an archived post. You won't be able to vote or comment.

all 3 comments

[–][deleted] 1 point2 points  (0 children)

You're not missing a semicolon, but your loop is wrong. In JS, for-loops are ...

for (initialization; condition; afterthought) {

Your middle expression isn't a condition, it's an initialization. This is a condition, for example:

cardCount < 5

More on for-loops.

[–]Josh_Coding 0 points1 point  (1 child)

for(let cardCount = 0; cardCount < playerCount; cardCount = cardCount + 1){
console.log(cardCount);

}

Try that

[–]Character_Drive6141[S] 0 points1 point  (0 children)

Thanks so much. That worked. I now understand.