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

hi do u know what the total marks is it:-A+Aplz tell me plz ​
Date: / ot of so from the tind the value proportion:x: 35:98:60. 2​
What is the rotation and axis of the lunar eclipse? Pls summarise in detail and asap
PLEASE HELP!! WHOEVER HELPS GETS BRAINLIEST!!
Solve the equation below. 3/2x - 2.2 = 2(0.7x - 1)
Answer of this all questions plz​
Which choice is equivalent to the product below when x > 0? Square root of 2/x time square root of x^2/8
There is a box of 100 miscellaneous balls that Brad wants to sell. b What is the total price for the box of balls if Brad charges $20 per ball?
Find the value of 9 - [4 2 - (3 + 2)]. 86-2
When , where , how , and why did the bantu migration emerge & what happened when they migrated