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 does number sentence mean
Ticks carry bacteria that cause Lyme disease. Ticks do not get Lyme disease, but they can transfer the bacteria to humans, who can get the disease. Which of the
4.3 as a percentage
What's a risk assessment
What is the prefix of fossil?
What value of x will satisfy the equation 0.2(x −2,700) = x?
If 4 (log3 1/27)=X what is the value of X
RATIO HELP PLEASE1. mrs perry shares out 20 biscuits between gemma and zak in the ratio 1:4. how many biscuits do they both get? 2. mr castle shares out 80 marb
For which achievement is Suleiman the magnificent best known?
Ashleigh rode her bicycle 26.5 miles in 4 hours.which gives best estimate of how far Ashleigh rode in 1 hour