For(i = 0; i < arrayLength; i++)

hey
long time ago i have been here,
good to see everything is better than before :slight_smile: Mery Christmas to all

im trying to learn more AC in flash 8 but i have problems with understanding some lines like this one, are used same formation in many codes i have seen can someone explane or give an url for to understand more, or what it is called

for(i = 0; i < arrayLength; i++)

the thing i do not understand is this line what does he mean like ( i < variable ) in this code and i know that the new number (i) is plussing it selv one more time with i++ and with (i=0) means i is 0 ? and its smaller than arrayLenth(var*)

im a bit confused about this.

hole code is here

var myArr:Array = new Array();

function initArray(arrayLength:Number):Void {

  var i:Number;

  for(i = 0; i < arrayLength; i++) {

    myArr* = i + 1;

  }

}

trace(myArr); // <blank>

initArray(3);

trace(myArr); // 1,2,3

trace(i); // undefined

but what i dont understand is

for(i = 0; i < arrayLength; i++) {

or like this one also uses same formation

_global.counter = 100; // Declares global variable

trace(counter); // Accesses the global variable and displays 100

function count():Void {

  for (var counter:Number = 0; counter <= 2; counter++) { // Local variable

    trace(counter); // Accesses local variable and displays 0 through 2

  }

}

count();

trace(counter); // Accesses global variable and displays 100

thank you very much