Code Ramp
Quiz by , created more than 1 year ago

Quiz on Loops, created by Code Ramp on 18/04/2018.

372
0
0
Code Ramp
Created by Code Ramp about 6 years ago
Close

Loops

Question 1 of 5

1

Which type of loop do you typically use when you know exactly how many iterations you will need to do?

Select one of the following:

  • While loop

  • For loop

Explanation

Question 2 of 5

1

Which type of loop would you use when you are not certain how many iterations you will need to do?

Select one of the following:

  • While loop

  • For loop

Explanation

Question 3 of 5

1

Which of the following do you need to define when you build a loop?

Select one or more of the following:

  • Exactly how many times you're going to run your loop

  • Where to start

  • How to make progress toward the end condition

  • Where to end

Explanation

Question 4 of 5

1

Which statement lets you skip one iteration of a loop?

Select one of the following:

  • Break

  • Continue

  • Pass

Explanation

Question 5 of 5

1

In the following for loop, which of the following semicolons (if any) are *not* correct syntax?

for (var i = 0; i < 10; i++); {
console.log(i);
};

Select one or more of the following:

  • Those inside the first set of parentheses (between each of the components of the loop)

  • The one after the first set of parentheses

  • The one after the console log statement

  • The one at the end of the for loop

Explanation