Skip to content

Instantly share code, notes, and snippets.

@macikokoro
Last active August 29, 2015 14:02
Show Gist options
  • Save macikokoro/9e9c1c5fb220c13ef703 to your computer and use it in GitHub Desktop.
Save macikokoro/9e9c1c5fb220c13ef703 to your computer and use it in GitHub Desktop.
Basic for loop
// for (start; stop; how much to change each time)
//if we change counter + 1 for counter + 2 console.log will print our every two numbers)
for (var counter = 1; counter <= 5; counter = counter + 1 )
{
// Everything in the code block starting with '{' and
// ending with '}' will run once each time through the loop
console.log(counter);
}
console.log("End of loop!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment