UX Design and Development course

For loops - don't repeat yourself, that's what computers are for

Set the initial var then define top end value then define forward increments

++i will increment the value of i, and then return the incremented value.

for (i = 0; i < 10; ++i) {
  console.log(i + ' ' + 'hello');
}

i++ will increment the value of x, but return the original value that x held before being incremented.

for (x = 0; x < 10; x+=3) {
  console.log(x + ' ' + 'there');
}

Play with code

JS Bin