javascript-loops Flashcards

1
Q

What is the purpose of a loop?

A

To perform something over and over so you don’t have to write code for again.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the purpose of a condition expression in a loop

A

So a loop doing go on infinitely and knows when to stop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what does iteration mean in the context of loops.

A

Each cycle of a loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When does the condition expression of a while loop get evaluation

A

Evaluated before each loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When does the initialization expression of a for loop get evaluated?

A

Once before the loop begins

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When does the condition expression of a for loop get evaluated?

A

Before each loop iteration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When does the final expression of a for loop get evaluated?

A

At the end of the loop iteration, before the condition is evaluated again.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Besides a return statement, which exits its entire function block, which keyword exits a loop before its condition expression evaluates to false?

A

break

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the ++ increment operator do?

A

Increment the variable by 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you iterate through the keys of an object?

A

for in statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly