Does JavaScript support for loop?

Yes.

Example:

var  friends=["Pole","Garry","Adam"];
for (var i=0;i<friends.length;i++)
{  
    alert( "On no: "+i +" Name: "+  friends [i] );
}

 

Leave a Reply