Loops


Let's write our first loop. For example, let's write all number from 0 to 9 into the console. You can find the template for the loop in the Templates>Language>loop for i++. The following code will be inserted:

for(i=0;i<10;i++){
  
}

This code counts up from 0 to 9. You can find other loops in the tab with templates for the descending or the while loop.
     Now we'll add the output of the number to the console using the system.println() method. You can use the system.print() method, which does the same job, but does not post a line break at the end of the message.
     Copy the following code and run the script. Check that everything is working correctly and in the output field there are entries i=0 up to 9.

for(i=0;i<10;i++){
    system.println('i='+i); 
}