JavaScript Work Out- Loops

JavaScript Work Out- Loops

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

for/in

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (10)

Section 1

(10 cards)

for/in

Front

loops through the properties of an object

Back

do/while

Front

also loops through a block of code while a specified condition is true

Back

for

Front

loops through a block of code a number of times

Back

Why loops?

Front

handy, if you want to run the same code over and over again, each time with a different value.

Back

For/In Loop syntax

Front

for (variable in object) { statements }

Back

For Loop Syntax

Front

for (statement 1; statement 2; statement 3) { code block to be executed }

Back

Loop

Front

can execute a block of code a number of times.

Back

While Loop Syntax

Front

while (conditionIsTrue) { code block to be executed }

Back

Do/While Loop Syntax

Front

do { code block to be executed } while (conditionIsTrue);

Back

while

Front

loops through a block of code while a specified condition is true

Back