How to do a for loop
May 26, 2020
Firsly, you need wash your hands. Go to the bathroom and take the soap.
Now we going to write a for loop:
for (statement 1; statement 2; statement 3) {
hackNASA()
}
A explanation:
statement 1
is executed (one time) before the execution of the code block.statement 2
defines the condition for executing the code block.statement 3
is executed (every time) after the code block has been executed.hackNASA()
to get a alien wallpaper.
Real life case of use:
for (let step = 0; step < 5; step++) {
hackNASA(step)
}
With this snippet you can get five alien wallpapers from the NASA database.