JavaScript Loops Worksheet
Questions
Question 1
What is the difference between a while loop and a for loop?
While loops keep executing until a specific condition is met, for loops is used when you know the iterations
Question 2
What is an iteration?
the repetition of a set of instructions or code.
Question 3
What is the meaning of the current element in a loop?
the value that is being processed during the current iteration of the loop
Question 4
What is a 'counter variable'?
a variable used to track the number of times a loop or an action has been performed in a program
Question 5
What does the break; statement do when used inside a loop?
immediately terminates the current loop and transfers control to the statement immediately following the loop.
Coding Problems
Coding Problems - See the 'script' tag below this h3 tag. You will have to write some JavaScript code in it.
Always test your work! Check the console log to make sure there are no errors.