Follow along and implement the code in the Loops module.
Input:
Output:
simpleLoopMain
function. Make the
loop run 6 times, adding "hello" to myOutputValue with each loop
iteration.
counter
starts as a number other than
zero?
counter
by adding a number other than one?
counter < 6
to counter <= 6
?
Input:
Output:
loopWithinLoop
function,
where the outer loop runs 3 times and the inner loop runs 3 times
per outer loop. Concatenate "hello"
to myOutputValue in
the inner loop. How many times do we see "hello"
?
<br />
" to myOutputValue
in the
outer loop so that the program makes a new line for each outer loop.
outerCounter
starts as a number other
than zero?
innerCounter
starts as a number other
than zero?
outerCounter
by adding a number other than one?
innerCounter
by adding a number other than one?
outerCounter < 3
to
outerCounter <= 3
?
innerCounter < 3
to
innerCounter <= 3
?
input
to control how many
times the loops run.
"hello"
?
Input:
Output:
Make a loop that never stops running. Be prepared to stop/kill this Chrome tab, because it will freeze.
Input:
Output: