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

1. What were some of the challenges that Chase encountered with setting up Buzzcar?
A new restaurant has ordered 64 tables for its outdoor patio. if the manager arranges the tables in a square formation, how many will be in each row ?
Simplify 7x +42/ x2+13x +42
A silicon chip is 14 nanometers thick. A nanometer is equal to 0.000000001 meter. Express the thickness of the chip using scientific notation.
how oxygen and carbon dioxide are produced
PLZ HELP Factor: x^9 - 9x + 20
I will give brainliest (I'm sorry if i cant type)Jamie is x years old. His friend Ana is the same age. Enter an expression in the box to represent the sum of Ja
IF F , G and H are the midpoints of the sides of triangleJKL, FG = 37 , KL = 48 , and GH = 30, find each measure
What equation represents the proportional relationship displayed in the table? X: 0, 3, 8, 13 Y: 0, 18, 48, 78 Enter your answer in the box to complete the equa
Y= -2x-9 in standard form