caydennnnn5074 caydennnnn5074
  • 13-05-2020
  • Computers and Technology
contestada

In a For loop the programmer must know the exact number of iterations the loop

must perform before writing the code.

True

False

Respuesta :

motojack500
motojack500 motojack500
  • 13-05-2020

False

while in many cases a for loop might loop through a preset amount of data the number of iterations can also be stored in a dynamic variable

Preset

for(var i = 0; i < 50; i++){

console.log(i);

}

/*returns

1

2

3

4

5

etc it keeps going until 50

*/

Dynamic

// array size can be changed and still work

var arr = ["a","b","c"];

for(var x = 0; x< arr.length; x++){

console.log(arr[x])

}

/*returns

"a"

"b"

"c"

*/

Answer Link

Otras preguntas

what damage did ww2 cause
Compare the composition of the Moon's surface with the composition of the Earth's surface.
A kindergarten class has 9 girls and 11 boys in class.What percent of the class are girlsit rain
Complete the following series logically by supplying the missing words. mayo, ____________________, julio a. abril c. agosto b. junio d. marzo Please selec
The sum of two consecutive mile markers on the interstate is 417417. Find the numbers on the markers
Find 1/8 of 12. Express your answer in simplest form.
What would happen to kenya's pyramid if there was a rapid decline in its: a) Birth rate b) Death rate
I need help ........... here’s a picture of the question
In each diagram, line p is parallel to line f, and line t intersects lines p and f. Based on the diagram, what is the value of x? (Please provide explanation)
what exercise allows you to specify the muscles to be trainedA. I sonicB. AnaerobicC. isometricD. Aerobic