answersLogoWhite

0

The for loop is used when you want to do a procedure, a certain amount of times.

The for loop is used when you already know how many times the loop will be repeated.

for example... you want to scan an array.

you can do something like this.

for(i=0;i<myArray.length;i++){

if(myArray[i] == 5){

alert("This array position contains the number five.");

}

}

the code above is javascript.

But the idea is the same in any language.

This is one use, but as I said. You use it when you already know the amount of times the loop will be repeated.

User Avatar

Wiki User

17y ago

What else can I help you with?

Related Questions

How can the word loops be used in a sentence?

Her garden appeared to be edged with loops of wrought iron.


Can arrays be used in for loops?

yes


What are the loops on the floor of a transit van called?

The loops on the floor of a transit van are called loop anchors. The loops are used to safely secure wheelchairs in the van.&Ecirc;


Why you use Loops?

Loops are used to repeat the execution of the same set of instructions again and again in a program.


What are loops in C?

In very simple terms, Loops in any language are used to perform a task repetitively.


What are loops in c language?

In very simple terms, Loops in any language are used to perform a task repetitively.


What technique is used to prevent bridge loops?

The mahmadur will get you


Which technology can be used in distance vector routing protocols to prevent routing loops?

Which two technologies can be used in distance vector routing protocols to prevent routing loops?


Which two technologies can be used in distance vector routing protocols to prevent routing loops?

Which two technologies can be used in distance vector routing protocols to prevent routing loops?


How can loops be used to process arrays give examples?

How_can_loops_be_used_to_process_arrays


What kind of negative loops are used to regulate chemical pathways?

Negative feedback loops are commonly used to regulate chemical pathways. In these loops, the end product of a pathway acts as a signal to inhibit further production, helping to maintain homeostasis and prevent overaccumulation of certain substances. This regulation ensures that the pathway operates efficiently and does not waste resources.


Would spinning the loops on an electromagnet make it stronger?

Spinning the loops on an electromagnet will not make it stronger. The strength of an electromagnet depends on factors such as the number of loops in the coil, the current passing through the coils, and the core material used in the electromagnet. Spinning the loops will not change these factors.