For the first loop


#1



What does the counter++ mean?


for (var counter = 1; counter < 11; counter++) {
	console.log(counter);
}


#2

It increments the variable counter so that the value changes by +1 every time so that the loop isn't infinite.


#3

@noobyprogrammer

What the counter does

  1. You create a variable called counter and assign it like value, 1.
  2. As long as counter is smaller than 11.
  3. We increment counter
  4. We print the value of counter in the console.
  5. The loop starts back again until counter is not smaller than 11

Hoped it helped! :slight_smile:


#4

so is
++ equal to +1?


#5

Yes.

counter++

is the same as

counter = counter + 1

#6

or

counter += 1

#7

cool Thanks. Alright one last question, will this work with ** or // ?


#8

@noobyprogrammer

Sorry but ** and // doesn't exist unless you talk about comments(by combining the two of them).